measure and speed up 2nd half of generate_index (#18503)

* add metrics and speedup storage calcs in generate_index

* add tests, refactor

* rename map variable

* rename another index variable
This commit is contained in:
Jeff Washington (jwash)
2021-07-15 10:26:00 -05:00
committed by GitHub
parent 0f8bcf65af
commit da9fdd785c
2 changed files with 176 additions and 26 deletions

View File

@@ -593,7 +593,7 @@ pub trait ZeroLamport {
fn is_zero_lamport(&self) -> bool;
}
fn get_bin_pubkey(pubkey: &Pubkey) -> usize {
pub(crate) fn get_bin_pubkey(pubkey: &Pubkey) -> usize {
let byte_of_pubkey_to_bin = 0; // TODO: this should not be 0. For now it needs to be due to requests for in-order pubkeys
(pubkey.as_ref()[byte_of_pubkey_to_bin] as usize) * BINS / ((u8::MAX as usize) + 1)
}