Skip to content

Commit

Permalink
move memory benchmark behind a flag
Browse files Browse the repository at this point in the history
  • Loading branch information
eaypek-tfh committed Jan 21, 2025
1 parent c85c402 commit ad7ceea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
3 changes: 3 additions & 0 deletions iris-mpc-common/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ pub struct Config {

#[serde(default)]
pub load_chunks_static_ips: usize,

#[serde(default)]
pub test_load_into_memory: bool,
}

fn default_load_chunks_parallelism() -> usize {
Expand Down
2 changes: 1 addition & 1 deletion iris-mpc-store/src/s3_importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ pub async fn fetch_to_memory(
match result.read_exact(&mut slice).await {
Ok(_) => {
let iris = S3StoredIris::from_bytes(&slice)?;
if iris.id % 10000 == 0 {
if iris.id % 100000 == 0 {
tracing::info!("Fetched iris with id: {}", iris.id);
}
}
Expand Down
31 changes: 17 additions & 14 deletions iris-mpc/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1181,20 +1181,23 @@ async fn server_main(config: Config) -> eyre::Result<()> {
db_chunks_folder_name.clone(),
)
.await?;
let fetch_test_ts = Instant::now();
fetch_to_memory(
Arc::new(db_chunks_s3_store),
load_chunks_parallelism,
db_chunks_folder_name.clone(),
last_snapshot_details.clone(),
)
.await?;
let elapsed = fetch_test_ts.elapsed();
tracing::info!(
"Fetch to memory took {:?} with {} par",
elapsed,
load_chunks_parallelism
);

if config.test_load_into_memory {
let fetch_test_ts = Instant::now();
fetch_to_memory(
Arc::new(db_chunks_s3_store),
load_chunks_parallelism,
db_chunks_folder_name.clone(),
last_snapshot_details.clone(),
)
.await?;
let elapsed = fetch_test_ts.elapsed();
tracing::info!(
"Fetch to memory took {:?} with {} par",
elapsed,
load_chunks_parallelism
);
}

let s3_store = S3Store::new(db_chunks_s3_client, db_chunks_bucket_name);
let s3_arc = Arc::new(s3_store);
Expand Down

0 comments on commit ad7ceea

Please sign in to comment.