MilesCranmer / DispatchDoctor.jl

The dispatch doctor prescribes type stability
Apache License 2.0
128 stars 6 forks source link

Cached access to Preferences.jl #39

Closed MilesCranmer closed 3 weeks ago

MilesCranmer commented 3 weeks ago

Surprisingly it takes ~600 us to load from Preferences.jl. This seems to slow down package load times, even if default_mode="disable". So this helps speed up Preferences.jl access via caching and an early exit if a "disable" is found.

Now it's under 1 us!

github-actions[bot] commented 3 weeks ago

Benchmark Results

main 2798749ef7cf18... main/2798749ef7cf18...
_stable/mode=disable 0.139 ± 0.0014 ms 0.721 ± 0.021 μs 193
_stable/mode=error 0.81 ± 0.017 ms 0.665 ± 0.016 ms 1.22
_stable/mode=warn 0.804 ± 0.033 ms 0.659 ± 0.02 ms 1.22
time_to_load 0.0674 ± 0.00069 s 0.0682 ± 0.0001 s 0.988

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR. Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

coveralls commented 3 weeks ago

Coverage Status

coverage: 99.71% (-0.3%) from 100.0% when pulling 2efd7bb80cba2ad434f79df2a41cf81e79ecba6e on faster-parsing into 77d8f38f5882079f6b84c327138a5d7df9df5c56 on main.

coveralls commented 3 weeks ago

Coverage Status

coverage: 100.0%. remained the same when pulling 6cfe8da22ee5cb653b3267a2589604c39f544812 on faster-parsing into 77d8f38f5882079f6b84c327138a5d7df9df5c56 on main.

coveralls commented 3 weeks ago

Coverage Status

coverage: 100.0%. remained the same when pulling 2798749ef7cf1828ef7923d3f1c84ac1c55db302 on faster-parsing into 77d8f38f5882079f6b84c327138a5d7df9df5c56 on main.