Skip to content

Commit 935872a

Browse files
authored
Remove a few vestigial mentions of JLD (#86)
1 parent aafc7e1 commit 935872a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

benchmark/benchmarks.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ end
3030
# If a cache of tuned parameters already exists, use it, otherwise, tune and cache
3131
# the benchmark parameters. Reusing cached parameters is faster and more reliable
3232
# than re-tuning `suite` every time the file is included.
33-
paramspath = joinpath(dirname(@__FILE__), "params.jld")
33+
paramspath = joinpath(dirname(@__FILE__), "params.json")
3434

3535
if isfile(paramspath)
36-
loadparams!(suite, BenchmarkTools.load(paramspath, "suite"), :evals);
36+
loadparams!(suite, BenchmarkTools.load(paramspath)[1], :evals);
3737
else
3838
tune!(suite)
39-
BenchmarkTools.save(paramspath, "suite", params(suite));
39+
BenchmarkTools.save(paramspath, params(suite));
4040
end

doc/manual.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ A common workflow used in BenchmarkTools is the following:
853853

854854
1. Start a Julia session
855855
2. Execute a benchmark suite using an old version of your package
856-
3. Save the results somehow (e.g. in a JLD file)
856+
3. Save the results somehow (e.g. in a JSON file)
857857
4. Start a new Julia session
858858
5. Execute a benchmark suite using a new version of your package
859859
6. Compare the new results with the results saved in step 3 to determine regression status
@@ -877,16 +877,16 @@ BenchmarkTools.BenchmarkGroup:
877877
julia> tune!(suite);
878878

879879
# save the suite's parameters using a thin wrapper
880-
# over JLD (this wrapper maintains compatibility
880+
# over JSON (this wrapper maintains compatibility
881881
# across BenchmarkTools versions)
882-
julia> BenchmarkTools.save("params.jld", "suite", params(suite));
882+
julia> BenchmarkTools.save("params.json", params(suite));
883883
```
884884

885-
Now, instead of tuning `suite` every time we load the benchmarks in a new Julia session, we can simply load the parameters in the JLD file using the `loadparams!` function:
885+
Now, instead of tuning `suite` every time we load the benchmarks in a new Julia session, we can simply load the parameters in the JSON file using the `loadparams!` function. The `[1]` on the `load` call gets the first value that was serialized into the JSON file, which in this case is the parameters.
886886

887887
```julia
888888
# syntax is loadparams!(group, paramsgroup, fields...)
889-
julia> loadparams!(suite, BenchmarkTools.load("params.jld", "suite"), :evals, :samples);
889+
julia> loadparams!(suite, BenchmarkTools.load("params.json")[1], :evals, :samples);
890890
```
891891

892892
Caching parameters in this manner leads to a far shorter turnaround time, and more importantly, much more consistent results.

doc/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ Return an iterator over `x`'s leaf index/value pairs. Relevant manual documentat
185185

186186
##### `save(filename, args...)`
187187

188-
Not exported. This function is a thin wrapper around a call to `JLD.save(filename, args...)` that maintains compatibility between BenchmarkTools versions.
188+
Not exported. This function calls `JSON.print` with custom serialization to write benchmarking data in a custom JSON format.
189189

190190
##### `load(filename, args...)`
191191

192-
Not exported. This function is a thin wrapper around a call to `JLD.load(filename, args...)` that maintains compatibility between BenchmarkTools versions.
192+
Not exported. This function calls `JSON.parse` with custom deserialization to read back benchmarking data written from `save`.
193193

194194
##### `loadparams!(x::Parameters, y::Parameters, fields...)`
195195
##### `loadparams!(x::Benchmark, y::Parameters, fields...)`

0 commit comments

Comments
 (0)