Comments (8)
Thanks for the link. I haven't seen this project before. It looks great BTW. For now, if I need to benchmark something multiple times on Linux from the command line I simply use perf -stat -r 10 -- <./app>
. But hyperfine may be slightly better way to do it.
For perf-ninja, all the labs are built on top of google benchmark library, which does all the measurements reporting. So hyperfine probably won't help us here.
What we need to do I think is something like this:
// for the current lab
- stash the changes
- rebuild & rerun the baseline lab
- restore the changes
- rebuild & rerun the modified lab
- measure the speedup.
from perf-ninja.
Actually, there is a potential solution, which doesn't require changes:
# 1. Build baseline
# 2. Cache baseline results
$ ./lab --benchmark_out_format=json --benchmark_out=result_baseline.json
# 3. Make changes to the lab & rebuild
$ ./lab --benchmark_out_format=json --benchmark_out=result_opt.json
# 4. Compare results:
$ compare.py benchmarks result_baseline.json result_opt.json
compare.py
script is here.
@mark2185, can you please check if this would work for you?
from perf-ninja.
I haven't nearly dug enough into this wonderful project (yet) to know the details of how you are doing this sort of thing, but I thought I should mention hyperfine as a possible tool to use for this if you aren't already :) If I'm not mistaken, it was pretty much created specifically for use cases like this.
from perf-ninja.
The baseline lab doesn't have to be run so often since it rarely changes.
I think a script for running all benchmarks and caching the results would suffice, which would be used manually on every master
update. Then you only need a second script to run for the 'current' lab and compare it to the cache.
from perf-ninja.
Yep, that should also work. In fact, we were talking about using this approach in CI with @andrewevstyukhin. Caching results in a JSON file is super easy with python. Does anyone want to help implementing it?
from perf-ninja.
Ah, yeah, I didn't know about the benchmark library, but that does look like it's probably the better choice here 👍 On the topic of Python scripts, there is apparently a small project named chronologger which runs benchmarks comparing git commits. Maybe that could be of some use as a reference?
from perf-ninja.
Fixed and described here:
https://github.com/dendibakh/perf-ninja/blob/main/GetStarted.md#local-experiments
from perf-ninja.
@mark2185, can you please check if this would work for you?
Yeah, sorry, I kept postponing this, but I'm sure it'll work out! Thanks! :)
from perf-ninja.
Related Issues (20)
- Permission denied HOT 3
- [Data Packing] Performance speedup gone after migrating to clang14 HOT 1
- [Proposal] integrate Rust labs
- Include a Requirements.md file HOT 2
- Warmup doesn't work on Mac M1 (macOS Monterey) HOT 2
- Move youtube thumbnails into the repo HOT 1
- [PGO] - profiling data out of date
- Develop Mac versions of solutions for a few labs HOT 9
- Create a Linux image with preinstalled tools
- [Lab proposal] offload computations to a GPU
- CMake commands fails to run on Mac M1 Ventura HOT 1
- CMake error when trying to build any lab HOT 3
- MSVC fails to build Optimize IO lab HOT 3
- Any guide on how to profiling and finding bottleneck on MacOSX? HOT 4
- Debug symbols not showing up in perf HOT 3
- CMake command for building Google benchmark is not correct. HOT 3
- Any hint about conditional_store_1 and virtual_call_mispredict? HOT 3
- Can't access , Permission to dendibakh/perf-ninja.git denied to 1100fe HOT 6
- Memory Order Violation lab: `An IO problem` happens when load `coins.pgm` for the first time on windows HOT 5
- Questions about deps chain 2 lab HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perf-ninja.