mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 02:49:55 +00:00
perf: Use smaller chunks
This commit is contained in:
@ -327,8 +327,8 @@ fn migrate_single_static_file<N: HlNodeType>(
|
|||||||
) -> Result<(), eyre::Error> {
|
) -> Result<(), eyre::Error> {
|
||||||
info!("Migrating block range {}...", block_range);
|
info!("Migrating block range {}...", block_range);
|
||||||
|
|
||||||
// block_ranges into chunks of 100000 blocks
|
// block_ranges into chunks of 10000 blocks
|
||||||
const CHUNK_SIZE: u64 = 100000;
|
const CHUNK_SIZE: u64 = 10000;
|
||||||
for chunk in (0..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
for chunk in (0..=block_range.end()).step_by(CHUNK_SIZE as usize) {
|
||||||
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
let end = std::cmp::min(chunk + CHUNK_SIZE - 1, block_range.end());
|
||||||
let block_range = chunk..=end;
|
let block_range = chunk..=end;
|
||||||
|
|||||||
Reference in New Issue
Block a user