Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stat for time spent copying generate index contents #33187

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

jeffwashington
Copy link
Contributor

Problem

Speeding up generate index/startup time.
We spend a ton of time copying data.

Summary of Changes

Add a metric for that time.

Fixes #

@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Merging #33187 (fe9beaa) into master (dc6b1eb) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           master   #33187   +/-   ##
=======================================
  Coverage    82.1%    82.1%           
=======================================
  Files         786      786           
  Lines      211596   211606   +10     
=======================================
+ Hits       173777   173851   +74     
+ Misses      37819    37755   -64     

@jeffwashington jeffwashington marked this pull request as ready for review September 8, 2023 16:59
@@ -516,6 +517,7 @@ impl BucketMapHolderStats {
.swap(0, Ordering::Relaxed),
i64
),
("copy_us", self.copy_us.swap(0, Ordering::Relaxed), i64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wdyt about a more descriptive name for this datapoint? Would startup_insert_us work? Or maybe startup_copy_us?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, moved these to generate_index stats. Reduces overall noise.

@@ -68,6 +70,8 @@ pub struct BucketMapHolder<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>>
/// Note startup is an optimization and is not required for correctness.
startup: AtomicBool,
_phantom: PhantomData<T>,

pub(crate) startup_stats: Arc<StartupStats>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are the startup stats also added here? Is this needed? Or maybe for a future use?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because the holder holds the accessible one. it gets retrieved from here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

each bin holds a reference to the common one. I guess they could all reference the common one instead.

@jeffwashington jeffwashington merged commit a145ade into solana-labs:master Sep 8, 2023
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants