Comments (5)
Your benchmarks are measuring dropping Vec
inputs because they use bench_values
. Switching to bench_refs
fixes the timings by deferring drop until after the loop.
Not sure why sleeping affects timings though.
from divan.
I see the issue here. You're setting max_time = 0.1
which also takes into account input generation time.
Internally it's hitting max_time
because the benchmark loop needs more iterations but then with_inputs
spends more of the time budget. This causes with_sleep
to only have enough time to record a single sample of 1, 8, or 64 iterations. To get accurate timings it needs to record multiple samples over more iterations.
Setting DIVAN_SAMPLE_SIZE=100
(instead of dynamic sample size) shows that sleeping in input generation doesn't affect timings.
from divan.
D'oh, forgot the drop. That fixes it for me - much appreciated!
Is the with_sleep
worth pursuing, or should we close this issue?
from divan.
I think sleeping affecting timing is a legit issue.
from divan.
I have fixed the linked example, with a simpler mm_pause
for busy sleeping. I need to sleep now.
from divan.
Related Issues (20)
- warmup HOT 2
- Paired Benchmarks HOT 5
- Fluctuating CPU MHz makes `tsc` profiling lie 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?
- feature request: clean up closure HOT 1
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.