Skip to content

Fix benchmark timing and minor warnings#168

Open
HFTrader wants to merge 1 commit intoefficient:masterfrom
HFTrader:fix-benchmark
Open

Fix benchmark timing and minor warnings#168
HFTrader wants to merge 1 commit intoefficient:masterfrom
HFTrader:fix-benchmark

Conversation

@HFTrader
Copy link
Copy Markdown

Summary

  • Fix timing bracket: Add a thread barrier before start_time in universal_benchmark so that thread creation overhead is excluded from throughput measurement. Previously, start_time was captured before spawning threads, inflating measured wall time by 10-50μs per thread.
  • Initialize variables: Initialize res1/res2 in cuckoo_insert to silence -Wmaybe-uninitialized. Both are always set by try_find_insert_bucket() before use, but the compiler cannot prove this statically.
  • Fix unused parameter: Remove unused parameter name in upsert_fn lambda to silence -Wunused-parameter.

Test plan

  • All existing unit tests pass
  • Universal benchmark builds and runs correctly
  • Benchmark results are consistent with pre-change (slightly higher throughput due to excluded thread creation overhead)

- Add thread barrier before starting the timer in universal_benchmark
  so that thread creation overhead is excluded from throughput
  measurement. Previously, start_time was captured before spawning
  threads, inflating measured wall time by 10-50us per thread.

- Initialize res1/res2 in cuckoo_insert to silence
  -Wmaybe-uninitialized. Both are always set by
  try_find_insert_bucket() before use, but the compiler cannot
  prove this statically.

- Fix unused parameter warning in upsert_fn lambda.
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.

1 participant