Comments (5)
Yes, when benchmarking / profiling code it's not uncommon to override the governor to use the performance governor to remove the "random" clock changes that normal governors will make. That's less about TSC & more about the fact that your code is actually taking a variable amount of time. And honestly, +/- 30% for something taking < 1ns isn't surprising. At that point, the loop counter used for doing the repeated iteration within the timing code is going to be a meaningful part of the measurement. Running within a VM is going to be another contributing factor for measurement error.
from divan.
Ultimately I spent quite a while in testing different configurations for this. What I need is benchmarks for something that's in the nanosecond range, where the benchmark will reliably tell if a new version is faster or slower than the old one, where reliably means maybe only 1 in twenty mistakes, but preferably 1 in a hundred.
I tried a lot of options with divan, also on a quiet desktop PC, but I was unable to achieve such reliable benchmarks. In the end, criterion ended up being the better choice for me, even though the benchmarks are really slow.
I don't know if there's any sense in keeping this "bug" open, so I'll close it.
from divan.
I tried a lot of options with divan, also on a quiet desktop PC, but I was unable to achieve such reliable benchmarks.
So is this issue not just with the TSC then?
from divan.
I don't think so. I have observed result instability For what it's worth as well. I suspect criterion has similar behavior and the main differentiating factor is the statistical analysis done within that crate more than the fact that they iterate so much.
from divan.
Yes, it happens also without TSC. But I need to spend a bit more time on this so I can actually give reasonable comments and not just guesswork.
from divan.
Related Issues (20)
- Output format to Markdown Tables HOT 1
- warmup HOT 2
- Paired Benchmarks HOT 5
- Benchmark within crate source code isn't running HOT 4
- Better document running benchmarks outside of `cargo bench` HOT 2
- Weird different benchmark results for code that should be fairly identical HOT 3
- RFC: Introduce `BenchmarkContext` argument for closure passed to benchmark function
- RFC: Ability to add post-result counters after HOT 2
- `bencher.with_inputs()` affects benchmark timing HOT 5
- Adding unrelated code affects benchmark HOT 5
- Reuse thread pool for threaded tests
- `cargo flamegraph` support HOT 2
- Support for async functions HOT 3
- Using `with_inputs` or not HOT 1
- Feature request: nextest support for divan
- Add statistically-significant improvement reporting
- Add support for optional callgrind / cachegrind integration HOT 1
- How do I initialise a structure so it's shared between threads of the same bench iteration?
- Sleeping in `Bencher::with_inputs` affects benchmark time HOT 5
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 divan.