Comments (4)
btime
inlines the computation for measuring repeated calls, while time
records the cost of the call occurring once. Both accurate measurements, but of different operations.
from benchmarktools.jl.
Hm, I'm confused 😕
So @btime
does not calculate the same operation? Does it execute the for-loop or not?
Because @time
executes the for-loop (it scales linearly with N where @btime
doesn't)
julia> @btime $f(100_000_000) evals=1 samples=1
365.000 ns (0 allocations: 0 bytes)
5000000050000000
julia> @time f(100_000_000)
0.107526 seconds
5000000050000000
from benchmarktools.jl.
It take the call f(10)
and creates a new function g() = f(10)
and then benchmarks the call to g
.
Now N
is known to be constant and the compiler can optimize that.
from benchmarktools.jl.
Ah, got it! Thanks @vchuravy @vtjnash !
from benchmarktools.jl.
Related Issues (20)
- Number of significant digits in @btime seems to be an overkill HOT 4
- How do you save benchmark results? HOT 2
- Warmups are skipped when running a benchmark suite HOT 15
- std and var broken
- Silence warnings when using `@benchmark` HOT 3
- Tuning ignores explicit evals parameter HOT 1
- Compiler optimization example outdated? HOT 2
- Unexpected Behaviour of `@btime` - cubic splines evaluation HOT 3
- Feature for just running the code without benchmarking HOT 1
- Unrealistic values of same tests after repeated executions HOT 8
- Document units of memory and time properties of Trial type
- Automatically create keys in BenchmarkGroup
- Memory estimate?
- Re-edit docs for multiple setup
- Add logo? HOT 26
- Run docs examples during CI instead of copypasting outputs
- `tune!` on benchmarkable with evals set. HOT 4
- @benchmark creates new symbol for each interpolation of a symbol HOT 3
- Removing `leaves` export 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 benchmarktools.jl.