Skip to content

perf: performance benchmarking with Criterion and dhat#51

Open
AThomas314 wants to merge 3 commits into
aarkue:mainfrom
AThomas314:benches
Open

perf: performance benchmarking with Criterion and dhat#51
AThomas314 wants to merge 3 commits into
aarkue:mainfrom
AThomas314:benches

Conversation

@AThomas314
Copy link
Copy Markdown

This PR introduces a performance benchmarking and profiling suite for the rust4pm library. By integrating Criterion for statistical time-series benchmarking and dhat for heap allocation profiling, this PR establishes the necessary infrastructure to track performance and prevent regressions as we continue to scale the engine.
Changes

Added Criterion as a dev-dependency for automated benchmarking of I/O and data conversion routines.

Added dhat as a dev-dependency for tracking memory allocations, critical for future memory-constrained optimization work.

Created four benchmarks:
    load_events: Measures time taken for disk-to-log ingestion.
    load_events_mem: Profiles heap usage during log ingestion.
    load_dataframe: Measures time taken to convert EventLog to polars::DataFrame.
    load_dataframe_mem: Profiles memory usage during DataFrame conversion.

How to Run
To execute the benchmarks, run:
cargo bench --features dataframes

Notes
This is the first phase PR, future PRs will include benchmarking of other functions

@aarkue
Copy link
Copy Markdown
Owner

aarkue commented May 24, 2026

Hi @AThomas314,
Thanks for your contributions! 😄
I won't have time to review your PRs next week, but hopefully I can get to them soon afterwards.

Generally, most additions seem to make sense, but I will let you know my exact thoughts in a more detailed review per PR.

One small observation already: The filepaths used in the benchmarks could likely benefit from the get_test_data_path function that already exists in lib.rs to be more robust.

Cheers,
Aaron

@AThomas314
Copy link
Copy Markdown
Author

Hey @aarkue,
Thanks for your feedback!
I've addressed it in the next commit within this PR.
Cheers,
Ashish

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