Skip to content

Parse expressions without interpolation #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 26, 2025

Conversation

MilesCranmer
Copy link
Member

I think this fixes custom operators in MilesCranmer/SymbolicRegression.jl#469

cc @gm89uk

Copy link
Contributor

github-actions bot commented Jul 26, 2025

Benchmark Results (Julia v1)

Time benchmarks
master e79b95c... master / e79b95c...
eval/ComplexF32/evaluation 7.23 ± 0.55 ms 7.25 ± 0.55 ms 0.997 ± 0.11
eval/ComplexF64/evaluation 10.8 ± 0.98 ms 10.8 ± 0.92 ms 1 ± 0.12
eval/Float32/derivative 11.8 ± 0.59 ms 11.8 ± 0.56 ms 1.01 ± 0.07
eval/Float32/derivative_turbo 11.8 ± 0.67 ms 11.8 ± 0.6 ms 1 ± 0.077
eval/Float32/evaluation 2.92 ± 0.29 ms 2.76 ± 0.29 ms 1.06 ± 0.15
eval/Float32/evaluation_bumper 0.582 ± 0.018 ms 0.579 ± 0.015 ms 1.01 ± 0.04
eval/Float32/evaluation_turbo 0.535 ± 0.03 ms 0.528 ± 0.03 ms 1.01 ± 0.082
eval/Float32/evaluation_turbo_bumper 0.581 ± 0.017 ms 0.578 ± 0.016 ms 1.01 ± 0.041
eval/Float64/derivative 14.7 ± 1 ms 14.7 ± 0.95 ms 0.999 ± 0.095
eval/Float64/derivative_turbo 14.7 ± 0.89 ms 14.8 ± 1.1 ms 0.995 ± 0.096
eval/Float64/evaluation 3.15 ± 0.33 ms 3.14 ± 0.33 ms 1 ± 0.15
eval/Float64/evaluation_bumper 1.21 ± 0.045 ms 1.19 ± 0.044 ms 1.01 ± 0.053
eval/Float64/evaluation_turbo 1.01 ± 0.063 ms 1.01 ± 0.067 ms 1 ± 0.091
eval/Float64/evaluation_turbo_bumper 1.21 ± 0.045 ms 1.19 ± 0.042 ms 1.01 ± 0.052
utils/combine_operators/break_sharing 0.0419 ± 0.0024 ms 0.0419 ± 0.0021 ms 1 ± 0.077
utils/convert/break_sharing 29.7 ± 4.4 μs 29.8 ± 4 μs 0.997 ± 0.2
utils/convert/preserve_sharing 0.101 ± 0.0069 ms 0.103 ± 0.0082 ms 0.982 ± 0.1
utils/copy/break_sharing 29.6 ± 4.3 μs 29.5 ± 4.1 μs 1 ± 0.2
utils/copy/preserve_sharing 0.102 ± 0.0073 ms 0.104 ± 0.0083 ms 0.984 ± 0.11
utils/count_constant_nodes/break_sharing 13.1 ± 1.5 μs 13.7 ± 1.5 μs 0.955 ± 0.15
utils/count_constant_nodes/preserve_sharing 0.086 ± 0.0053 ms 0.0874 ± 0.0063 ms 0.984 ± 0.094
utils/count_depth/break_sharing 14.3 ± 1.7 μs 14.3 ± 1.9 μs 1 ± 0.18
utils/count_nodes/break_sharing 12.2 ± 1.5 μs 12.8 ± 1.4 μs 0.959 ± 0.16
utils/count_nodes/preserve_sharing 0.0868 ± 0.0053 ms 0.088 ± 0.0061 ms 0.987 ± 0.091
utils/get_set_constants!/break_sharing 0.0341 ± 0.003 ms 0.034 ± 0.0029 ms 1 ± 0.12
utils/get_set_constants!/preserve_sharing 0.18 ± 0.0093 ms 0.182 ± 0.01 ms 0.991 ± 0.076
utils/get_set_constants_parametric 0.0506 ± 0.0066 ms 0.0514 ± 0.0062 ms 0.985 ± 0.18
utils/has_constants/break_sharing 7.64 ± 1.1 μs 7.73 ± 0.95 μs 0.99 ± 0.19
utils/has_operators/break_sharing 2.58 ± 0.17 μs 2.52 ± 0.19 μs 1.02 ± 0.1
utils/hash/break_sharing 24 ± 2.4 μs 24.4 ± 2.4 μs 0.983 ± 0.14
utils/hash/preserve_sharing 0.101 ± 0.0064 ms 0.1 ± 0.0057 ms 1.01 ± 0.086
utils/index_constant_nodes/break_sharing 30.4 ± 3.1 μs 30.2 ± 3 μs 1.01 ± 0.14
utils/index_constant_nodes/preserve_sharing 0.103 ± 0.006 ms 0.104 ± 0.0073 ms 0.994 ± 0.091
utils/is_constant/break_sharing 8.28 ± 1 μs 8.41 ± 1.1 μs 0.984 ± 0.18
utils/simplify_tree/break_sharing 26.5 ± 2.8 μs 26.8 ± 2.7 μs 0.99 ± 0.14
utils/simplify_tree/preserve_sharing 0.109 ± 0.0061 ms 0.109 ± 0.0064 ms 0.992 ± 0.081
utils/string_tree/break_sharing 0.477 ± 0.024 ms 0.48 ± 0.022 ms 0.994 ± 0.067
utils/string_tree/preserve_sharing 0.571 ± 0.022 ms 0.57 ± 0.022 ms 1 ± 0.055
time_to_load 0.23 ± 0.0014 s 0.233 ± 0.00064 s 0.986 ± 0.0066
Memory benchmarks
master e79b95c... master / e79b95c...
eval/ComplexF32/evaluation 0.972 k allocs: 2.49 MB 0.978 k allocs: 2.5 MB 0.994
eval/ComplexF64/evaluation 0.999 k allocs: 5.09 MB 0.999 k allocs: 5.09 MB 1
eval/Float32/derivative 4.64 k allocs: 17.5 MB 4.7 k allocs: 17.7 MB 0.987
eval/Float32/derivative_turbo 4.64 k allocs: 17.5 MB 4.69 k allocs: 17.7 MB 0.99
eval/Float32/evaluation 0.996 k allocs: 1.3 MB 0.984 k allocs: 1.28 MB 1.01
eval/Float32/evaluation_bumper 0.303 k allocs: 0.393 MB 0.303 k allocs: 0.393 MB 1
eval/Float32/evaluation_turbo 0.966 k allocs: 1.26 MB 0.963 k allocs: 1.25 MB 1
eval/Float32/evaluation_turbo_bumper 0.303 k allocs: 0.393 MB 0.303 k allocs: 0.393 MB 1
eval/Float64/derivative 4.79 k allocs: 0.035 GB 4.82 k allocs: 0.0353 GB 0.994
eval/Float64/derivative_turbo 4.83 k allocs: 0.0353 GB 4.78 k allocs: 0.035 GB 1.01
eval/Float64/evaluation 0.996 k allocs: 2.55 MB 0.975 k allocs: 2.5 MB 1.02
eval/Float64/evaluation_bumper 0.303 k allocs: 0.771 MB 0.303 k allocs: 0.771 MB 1
eval/Float64/evaluation_turbo 0.978 k allocs: 2.5 MB 0.99 k allocs: 2.53 MB 0.988
eval/Float64/evaluation_turbo_bumper 0.303 k allocs: 0.771 MB 0.303 k allocs: 0.771 MB 1
utils/combine_operators/break_sharing 4 allocs: 0.953 kB 4 allocs: 0.953 kB 1
utils/convert/break_sharing 2 k allocs: 0.123 MB 2 k allocs: 0.123 MB 1
utils/convert/preserve_sharing 2.4 k allocs: 0.192 MB 2.4 k allocs: 0.192 MB 1
utils/copy/break_sharing 2 k allocs: 0.123 MB 2 k allocs: 0.123 MB 1
utils/copy/preserve_sharing 2.4 k allocs: 0.192 MB 2.4 k allocs: 0.192 MB 1
utils/count_constant_nodes/break_sharing 4 allocs: 0.953 kB 4 allocs: 0.953 kB 1
utils/count_constant_nodes/preserve_sharing 0.404 k allocs: 0.0696 MB 0.404 k allocs: 0.0696 MB 1
utils/count_depth/break_sharing 4 allocs: 0.953 kB 4 allocs: 0.953 kB 1
utils/count_nodes/break_sharing 4 allocs: 0.953 kB 4 allocs: 0.953 kB 1
utils/count_nodes/preserve_sharing 0.404 k allocs: 0.0696 MB 0.404 k allocs: 0.0696 MB 1
utils/get_set_constants!/break_sharing 0.898 k allocs: 25.2 kB 0.898 k allocs: 25.2 kB 1
utils/get_set_constants!/preserve_sharing 1.7 k allocs: 0.138 MB 1.7 k allocs: 0.138 MB 1
utils/get_set_constants_parametric 1.42 k allocs: 0.0663 MB 1.42 k allocs: 0.0663 MB 1
utils/has_constants/break_sharing 4 allocs: 0.203 kB 4 allocs: 0.203 kB 1
utils/has_operators/break_sharing 4 allocs: 0.203 kB 4 allocs: 0.203 kB 1
utils/hash/break_sharing 0.104 k allocs: 2.52 kB 0.104 k allocs: 2.52 kB 1
utils/hash/preserve_sharing 0.504 k allocs: 0.0711 MB 0.504 k allocs: 0.0711 MB 1
utils/index_constant_nodes/break_sharing 2.1 k allocs: 0.094 MB 2.1 k allocs: 0.094 MB 1
utils/index_constant_nodes/preserve_sharing 2.5 k allocs: 0.163 MB 2.5 k allocs: 0.163 MB 1
utils/is_constant/break_sharing 4 allocs: 0.203 kB 4 allocs: 0.203 kB 1
utils/simplify_tree/break_sharing 4 allocs: 0.953 kB 4 allocs: 0.953 kB 1
utils/simplify_tree/preserve_sharing 0.404 k allocs: 0.0696 MB 0.404 k allocs: 0.0696 MB 1
utils/string_tree/break_sharing 11.8 k allocs: 1.04 MB 11.8 k allocs: 1.04 MB 1
utils/string_tree/preserve_sharing 12.2 k allocs: 1.11 MB 12.2 k allocs: 1.11 MB 1
time_to_load 0.159 k allocs: 11.2 kB 0.159 k allocs: 11.2 kB 1

@MilesCranmer MilesCranmer merged commit 1a1f2db into master Jul 26, 2025
12 checks passed
@MilesCranmer MilesCranmer deleted the parse-without-interpolation branch July 26, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant