You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deprecate @lookup macro in favor of lookup function (#685)
The `@lookup frame node` macro effectively inlines code in the caller’s
context to choose lookup subroutines based on the type of `node`, but
there’s no performance benefit to doing this.
A regular function call should deliver equivalent performance, and using
a function improves maintainability. Below are the benchmark results:
> master (49220f9)
```
julia> run(SUITE["recursive self 1_000"])
BenchmarkTools.Trial: 1254 samples with 1 evaluation per sample.
Range (min … max): 3.634 ms … 13.210 ms ┊ GC (min … max): 0.00% … 0.00%
Time (median): 3.845 ms ┊ GC (median): 0.00%
Time (mean ± σ): 3.979 ms ± 514.632 μs ┊ GC (mean ± σ): 2.15% ± 6.18%
▄▇▆█▆▂▁
▃▇███████▇▇▇▅▄▅▄▄▄▃▃▂▂▂▂▁▁▁▁▂▂▁▂▂▂▂▂▂▂▂▁▂▂▂▂▂▂▂▃▂▂▃▂▂▂▂▂▁▂▂ ▃
3.63 ms Histogram: frequency by time 5.54 ms <
Memory estimate: 1.33 MiB, allocs estimate: 44348.
julia> run(SUITE["tight loop 10_000"])
BenchmarkTools.Trial: 29 samples with 1 evaluation per sample.
Range (min … max): 170.913 ms … 188.887 ms ┊ GC (min … max): 0.00% … 0.46%
Time (median): 176.319 ms ┊ GC (median): 0.70%
Time (mean ± σ): 176.275 ms ± 3.806 ms ┊ GC (mean ± σ): 0.61% ± 0.42%
▁▁▁▁ ▁ █ █▁▁▁ █ █ █▁▁█▁▁ ▁▁ ▁ ▁ ▁
████▁█▁█▁████▁▁▁█▁█▁▁██████▁██▁█▁▁▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
171 ms Histogram: frequency by time 189 ms <
Memory estimate: 24.09 MiB, allocs estimate: 1386513.
julia> run(SUITE["throw long 1_000"])
BenchmarkTools.Trial: 157 samples with 1 evaluation per sample.
Range (min … max): 29.388 ms … 151.134 ms ┊ GC (min … max): 0.00% … 13.02%
Time (median): 30.651 ms ┊ GC (median): 0.00%
Time (mean ± σ): 31.861 ms ± 9.778 ms ┊ GC (mean ± σ): 0.94% ± 2.53%
▂▅▇█ ▁
▃██████▆█▆▆▃▁▃▁▃▁▃▁▁▃▃▁▁▃▁▃▁▃▁▁▁▁▁▃▃▁▁▁▁▁▁▁▁▁▁▁▁▁▃▁▁▁▁▁▁▁▁▁▃ ▃
29.4 ms Histogram: frequency by time 42.2 ms <
Memory estimate: 3.75 MiB, allocs estimate: 85380.
```
> this PR
```
julia> run(SUITE["recursive self 1_000"])
BenchmarkTools.Trial: 1277 samples with 1 evaluation per sample.
Range (min … max): 3.662 ms … 7.569 ms ┊ GC (min … max): 0.00% … 49.27%
Time (median): 3.809 ms ┊ GC (median): 0.00%
Time (mean ± σ): 3.908 ms ± 341.900 μs ┊ GC (mean ± σ): 1.76% ± 5.62%
▃▅█▄▂▂
▄▇██████▇▄▄▃▃▃▃▃▃▃▃▃▃▂▂▂▁▂▂▂▂▁▂▁▁▁▁▁▁▁▂▁▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ▃
3.66 ms Histogram: frequency by time 5.27 ms <
Memory estimate: 1.33 MiB, allocs estimate: 44348.
julia> run(SUITE["tight loop 10_000"])
BenchmarkTools.Trial: 29 samples with 1 evaluation per sample.
Range (min … max): 170.863 ms … 178.231 ms ┊ GC (min … max): 0.57% … 2.61%
Time (median): 173.559 ms ┊ GC (median): 0.56%
Time (mean ± σ): 173.568 ms ± 1.643 ms ┊ GC (mean ± σ): 0.55% ± 0.57%
▁█ ▁ █ ▁ ▁▁ ▁▁▁█▁▁▁█ ██▁ ▁ ▁ ▁ ▁ ▁
██▁▁▁█▁▁▁█▁█▁██▁▁▁████████▁███▁▁▁█▁▁▁█▁▁█▁▁▁█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█ ▁
171 ms Histogram: frequency by time 178 ms <
Memory estimate: 24.09 MiB, allocs estimate: 1386514.
julia> run(SUITE["throw long 1_000"])
BenchmarkTools.Trial: 175 samples with 1 evaluation per sample.
Range (min … max): 27.760 ms … 37.426 ms ┊ GC (min … max): 0.00% … 20.80%
Time (median): 28.402 ms ┊ GC (median): 0.00%
Time (mean ± σ): 28.698 ms ± 1.185 ms ┊ GC (mean ± σ): 0.65% ± 2.76%
▄█▄▁ ▄
▃▅█████▇▇█▄▄▂▃▂▂▃▁▂▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▁▁▂▁▁▁▁▁▁▂▂▁▁▁▁▁▂▁▁▁▁▁▁▁▂ ▂
27.8 ms Histogram: frequency by time 34.3 ms <
Memory estimate: 3.75 MiB, allocs estimate: 85380.
```
0 commit comments