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

Add some benchmarking tools #155

Merged
merged 5 commits into from
Dec 18, 2020
Merged

Conversation

tmadlener
Copy link
Collaborator

BEGINRELEASENOTES

  • Add some benchmarking tools, including TimedReader and TimedWriter decorators that allow to wrap (interface conforming) readers and writers and record the times different operations take. The times are recorded on two levels: setup times, like constructing a reader or "one-time" calls and per event times, for things that happen each event (e.g. writeEvent or readCollection). Additionally the BenchmarkRecorder in principle also allows to track additional things outside of these decorators.

ENDRELEASENOTES

This PR adds some generic utility functionality to wrap member function calls in between pairs of calls to std::chrono::high_resolution_clock::now() to calculate how long the execution takes. These utilities, placed in the podio::benchmark namespace are then used in the static TimedWriter and TimedReader decorators together with the BenchmarkRecorder class that takes care of recording the times at different granularities into a root file.

In the end, I think, the interface for using this is not too bad, as can be seen by the usage of two newly added tests that use these decorators. Basically, it is necessary to setup a podio::benchmark::BenchmarkRecorder and pass that to the decorators as first argument during construction. From that point on the decorated reader/writer should work exactly the same as the undecorated ones.

Necessary to make it easier to use the TimedWriter decorator with it.
- Making use of some rather general utilities that simply wrap calls to
member functions inbetween two calls to clock::now() to calculate the
duration of the call.
@gaede gaede merged commit dbc81e6 into AIDASoft:master Dec 18, 2020
@tmadlener tmadlener deleted the io-benchmarking branch January 19, 2021 16:10
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