SymbolicML / DynamicExpressions.jl

Ridiculously fast symbolic expressions
https://symbolicml.org/DynamicExpressions.jl/dev
Apache License 2.0
90 stars 11 forks source link

Avoid method invalidation in helper functions #44

Closed MilesCranmer closed 10 months ago

MilesCranmer commented 10 months ago

Needed for v1.10 to avoid the list of method invalidation warnings.

This also increases safety of the helper functions (e.g., using * on two Node types), by checking whether the operator was redefined or not.

github-actions[bot] commented 10 months ago

Benchmark Results

master 3f01acd026bab4... t[master]/t[3f01acd026bab4...]
eval/ComplexF32/evaluation 13.8 ± 1.8 ms 13.5 ± 1 ms 1.02
eval/ComplexF64/evaluation 17.2 ± 2.2 ms 16.8 ± 1.8 ms 1.03
eval/Float32/derivative 27.2 ± 4.7 ms 25.2 ± 3.7 ms 1.08
eval/Float32/derivative_turbo 26.4 ± 4.5 ms 26 ± 4 ms 1.02
eval/Float32/evaluation 4.72 ± 0.53 ms 4.66 ± 0.44 ms 1.01
eval/Float32/evaluation_turbo 1.47 ± 0.15 ms 1.45 ± 0.14 ms 1.02
eval/Float64/derivative 0.0366 ± 0.0023 s 0.035 ± 0.0021 s 1.05
eval/Float64/derivative_turbo 0.0395 ± 0.0024 s 0.0386 ± 0.0016 s 1.02
eval/Float64/evaluation 5.1 ± 0.57 ms 5.04 ± 0.5 ms 1.01
eval/Float64/evaluation_turbo 2.73 ± 0.24 ms 2.69 ± 0.22 ms 1.01
time_to_load 1.21 ± 0.045 s 1.19 ± 0.0092 s 1.01
utils/combine_operators 0.0718 ± 0.012 ms 0.072 ± 0.013 ms 0.997
utils/convert/break_sharing 0.0681 ± 0.017 ms 0.0697 ± 0.018 ms 0.977
utils/convert/preserve_sharing 0.283 ± 0.054 ms 0.288 ± 0.053 ms 0.983
utils/copy/break_sharing 0.0638 ± 0.017 ms 0.0634 ± 0.017 ms 1.01
utils/copy/preserve_sharing 0.285 ± 0.045 ms 0.28 ± 0.048 ms 1.02
utils/count_constants 30.9 ± 5 μs 29.9 ± 4.8 μs 1.03
utils/count_depth 0.0349 ± 0.0055 ms 0.034 ± 0.0051 ms 1.03
utils/count_nodes 30.1 ± 5.4 μs 29.7 ± 5 μs 1.02
utils/get_set_constants! 0.115 ± 0.015 ms 0.114 ± 0.019 ms 1.01
utils/has_constants 10.3 ± 1.7 μs 10.9 ± 1.7 μs 0.941
utils/has_operators 2.84 ± 0.22 μs 2.6 ± 0.26 μs 1.09
utils/index_constants 0.0979 ± 0.018 ms 0.0935 ± 0.017 ms 1.05
utils/is_constant 11.1 ± 1.8 μs 10.6 ± 1.8 μs 1.05
utils/simplify_tree 0.228 ± 0.037 ms 0.224 ± 0.043 ms 1.02
utils/string_tree 0.457 ± 0.065 ms 0.453 ± 0.07 ms 1.01

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).