cleanup a stat call to `is_ancient` (#31621)
cleanup some calls to `is_ancient`
This commit is contained in:
parent
656d93d805
commit
6172b0d50c
|
@ -7086,13 +7086,11 @@ impl AccountsDb {
|
||||||
where
|
where
|
||||||
S: AppendVecScan,
|
S: AppendVecScan,
|
||||||
{
|
{
|
||||||
let splitter = SplitAncientStorages::new(
|
let oldest_non_ancient_slot = self.get_oldest_non_ancient_slot_for_hash_calc_scan(
|
||||||
self.get_oldest_non_ancient_slot_for_hash_calc_scan(
|
|
||||||
snapshot_storages.max_slot_inclusive(),
|
snapshot_storages.max_slot_inclusive(),
|
||||||
config,
|
config,
|
||||||
),
|
|
||||||
snapshot_storages,
|
|
||||||
);
|
);
|
||||||
|
let splitter = SplitAncientStorages::new(oldest_non_ancient_slot, snapshot_storages);
|
||||||
|
|
||||||
stats.scan_chunks = splitter.chunk_count;
|
stats.scan_chunks = splitter.chunk_count;
|
||||||
(0..splitter.chunk_count)
|
(0..splitter.chunk_count)
|
||||||
|
@ -7152,9 +7150,8 @@ impl AccountsDb {
|
||||||
let mut init_accum = true;
|
let mut init_accum = true;
|
||||||
// load from cache failed, so create the cache file for this chunk
|
// load from cache failed, so create the cache file for this chunk
|
||||||
for (slot, storage) in snapshot_storages.iter_range(&range_this_chunk) {
|
for (slot, storage) in snapshot_storages.iter_range(&range_this_chunk) {
|
||||||
let mut ancient = false;
|
let ancient = slot < oldest_non_ancient_slot;
|
||||||
let (_, scan_us) = measure_us!(if let Some(storage) = storage {
|
let (_, scan_us) = measure_us!(if let Some(storage) = storage {
|
||||||
ancient = is_ancient(&storage.accounts);
|
|
||||||
if init_accum {
|
if init_accum {
|
||||||
let range = bin_range.end - bin_range.start;
|
let range = bin_range.end - bin_range.start;
|
||||||
scanner.init_accum(range);
|
scanner.init_accum(range);
|
||||||
|
|
Loading…
Reference in New Issue