SymbolicML / DynamicExpressions.jl

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

Clean up IdDict use with macro #17

Closed MilesCranmer closed 1 year ago

MilesCranmer commented 1 year ago

This should greatly speed up the simplify_tree and combine_operators functions, as before this change they made the assumption that a child node might have multiple parent nodes.

TODO:

coveralls commented 1 year ago

Pull Request Test Coverage Report for Build 4775403269


Changes Missing Coverage Covered Lines Changed/Added Lines %
src/SimplifyEquation.jl 80 82 97.56%
<!-- Total: 125 127 98.43% -->
Files with Coverage Reduction New Missed Lines %
src/EvaluateEquation.jl 1 99.62%
<!-- Total: 1 -->
Totals Coverage Status
Change from base Build 4774460028: -0.06%
Covered Lines: 958
Relevant Lines: 1071

💛 - Coveralls
MilesCranmer commented 1 year ago

@AlCap23 would you be up for a quick review of this?

github-actions[bot] commented 1 year ago

Benchmark Results

master ea3e91c921c553... t[master]/t[ea3e91c921c553...]
eval/ComplexF32/evaluation 10.4 ± 0.69 ms 10.2 ± 0.58 ms 1.03
eval/ComplexF64/evaluation 12.5 ± 0.76 ms 12.5 ± 0.82 ms 0.997
eval/Float32/derivative 15.5 ± 0.82 ms 15.7 ± 0.93 ms 0.983
eval/Float32/derivative_turbo 18.4 ± 0.69 ms 18.5 ± 0.67 ms 0.997
eval/Float32/evaluation 3.56 ± 0.28 ms 3.55 ± 0.28 ms 1
eval/Float32/evaluation_turbo 0.884 ± 0.035 ms 0.869 ± 0.034 ms 1.02
eval/Float64/derivative 20 ± 2.4 ms 19.3 ± 2.5 ms 1.04
eval/Float64/derivative_turbo 23 ± 2.4 ms 22.9 ± 2.5 ms 1
eval/Float64/evaluation 4.11 ± 0.33 ms 4.15 ± 0.31 ms 0.992
eval/Float64/evaluation_turbo 1.31 ± 0.049 ms 1.32 ± 0.055 ms 0.991
time_to_load 12.4 ± 0.017 s 12.3 ± 0.019 s 1
utils/combine_operators/break_sharing 0.056 ± 0.0028 ms 0.0561 ± 0.003 ms 0.998
utils/convert/break_sharing 0.0518 ± 0.0077 ms 0.0518 ± 0.0071 ms 1
utils/convert/preserve_sharing 0.24 ± 0.011 ms 0.238 ± 0.0093 ms 1.01
utils/copy/break_sharing 0.0484 ± 0.0086 ms 0.0481 ± 0.0071 ms 1.01
utils/copy/preserve_sharing 0.24 ± 0.013 ms 0.235 ± 0.009 ms 1.02
utils/simplify_tree/break_sharing 0.163 ± 0.017 ms 0.163 ± 0.016 ms 1

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