Skip to content

avoid making variables for constant numbers#918

Open
KristofferC wants to merge 1 commit into
JuliaSymbolics:masterfrom
KristofferC:kc/cse_numbers
Open

avoid making variables for constant numbers#918
KristofferC wants to merge 1 commit into
JuliaSymbolics:masterfrom
KristofferC:kc/cse_numbers

Conversation

@KristofferC
Copy link
Copy Markdown
Contributor

CSE of constants makes variables much more connected to each other than they are in reality, making it harder to decouple them into e.g., separate functions at a later stage

Before (where the same variable is used as an index and an operand which is kind of weird (dimensional error):

var"##cse#47" = 1
var"##cse#48" = var"##cse#46"[var"##cse#47"]
...
var"##cse#487" = (+)(var"##cse#47", var"##cse#486")

after:

var"##cse#48" = var"##cse#46"[1]
...
var"##cse#487" = (+)(1, var"##cse#486")

Probably needs some test but I am a bit unfamiliar with the code base.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Benchmark Results (Julia vlts)

Time benchmarks
master f705847... master / f705847...
arithmetic/2-arg mul 12.8 ± 0.37 μs 12.8 ± 0.39 μs 0.998 ± 0.042
arithmetic/addition 0.0796 ± 0.0027 ms 0.0764 ± 0.0017 ms 1.04 ± 0.042
arithmetic/division 24.4 ± 2 μs 24.4 ± 2 μs 1 ± 0.12
arithmetic/multiplication 0.0581 ± 0.002 ms 0.057 ± 0.0031 ms 1.02 ± 0.065
codegen/arrayop_nested/fast_toexpr 10.3 ± 1.8 μs 10.4 ± 1.7 μs 0.992 ± 0.24
codegen/arrayop_nested/toexpr 0.054 ± 0.0038 ms 0.0534 ± 0.0033 ms 1.01 ± 0.094
codegen/deep_poly/deg=10:fast_toexpr 0.0769 ± 0.01 ms 0.0718 ± 0.0083 ms 1.07 ± 0.19
codegen/deep_poly/deg=10:toexpr 0.0678 ± 0.006 ms 0.0662 ± 0.0042 ms 1.02 ± 0.11
codegen/deep_poly/deg=14:fast_toexpr 0.143 ± 0.016 ms 0.13 ± 0.015 ms 1.1 ± 0.18
codegen/deep_poly/deg=14:toexpr 0.122 ± 0.011 ms 0.119 ± 0.011 ms 1.02 ± 0.14
codegen/deep_poly/deg=6:fast_toexpr 0.0354 ± 0.0047 ms 0.0327 ± 0.0035 ms 1.08 ± 0.19
codegen/deep_poly/deg=6:toexpr 29.6 ± 3.2 μs 28.8 ± 2.1 μs 1.03 ± 0.13
codegen/makearray/n=100:fast_toexpr 0.0785 ± 0.011 ms 0.0674 ± 0.0072 ms 1.17 ± 0.2
codegen/makearray/n=100:toexpr 0.534 ± 0.024 ms 0.534 ± 0.025 ms 1 ± 0.066
codegen/makearray/n=200:fast_toexpr 0.131 ± 0.016 ms 0.114 ± 0.012 ms 1.15 ± 0.19
codegen/makearray/n=200:toexpr 0.768 ± 0.034 ms 0.767 ± 0.031 ms 1 ± 0.06
codegen/makearray/n=400:fast_toexpr 0.246 ± 0.029 ms 0.22 ± 0.023 ms 1.12 ± 0.18
codegen/makearray/n=400:toexpr 1.23 ± 0.055 ms 1.23 ± 0.05 ms 1 ± 0.06
codegen/wide_deep_poly/fast_toexpr 0.588 ± 0.041 ms 0.529 ± 0.047 ms 1.11 ± 0.12
codegen/wide_deep_poly/toexpr 0.442 ± 0.023 ms 0.44 ± 0.021 ms 1 ± 0.07
codegen/wide_poly/n=100:fast_toexpr 0.25 ± 0.029 ms 0.207 ± 0.026 ms 1.21 ± 0.21
codegen/wide_poly/n=100:toexpr 0.258 ± 0.024 ms 0.252 ± 0.02 ms 1.03 ± 0.12
codegen/wide_poly/n=25:fast_toexpr 0.0543 ± 0.0079 ms 0.0468 ± 0.0054 ms 1.16 ± 0.22
codegen/wide_poly/n=25:toexpr 0.0634 ± 0.0082 ms 0.0618 ± 0.0054 ms 1.03 ± 0.16
codegen/wide_poly/n=50:fast_toexpr 0.115 ± 0.014 ms 0.0961 ± 0.013 ms 1.2 ± 0.22
codegen/wide_poly/n=50:toexpr 0.128 ± 0.015 ms 0.125 ± 0.012 ms 1.03 ± 0.16
irstructure/search_variables/common:IRStructure 0.23 ± 0.0074 ms 0.227 ± 0.0071 ms 1.01 ± 0.046
irstructure/search_variables/common:reference 1.47 ± 0.012 ms 1.15 ± 0.0088 ms 1.28 ± 0.014
irstructure/search_variables/dissimilar:IRStructure 0.0578 ± 0.0018 ms 0.0585 ± 0.003 ms 0.989 ± 0.059
irstructure/search_variables/dissimilar:reference 0.311 ± 0.0095 ms 0.243 ± 0.01 ms 1.28 ± 0.066
irstructure/substitute/IRSubstituter 9.75 ± 1.1 ms 9.06 ± 0.37 ms 1.08 ± 0.13
irstructure/substitute/reference 11.6 ± 1.2 ms 9.92 ± 0.93 ms 1.16 ± 0.16
irstructure/substitute/sparse IRSubstituter 1.47 ± 0.04 ms 1.41 ± 0.03 ms 1.04 ± 0.036
irstructure/substitute/sparse reference 2.33 ± 0.068 ms 2.15 ± 0.041 ms 1.08 ± 0.038
overhead/acrule/a+2 2.59 ± 0.13 μs 2.53 ± 0.12 μs 1.02 ± 0.072
overhead/acrule/a+2+b 0.07 ± 0.01 μs 0.06 ± 0.01 μs 1.17 ± 0.26
overhead/acrule/a+b 4.55 ± 0.2 μs 4.52 ± 0.21 μs 1.01 ± 0.064
overhead/acrule/noop:Int 0.05 ± 0 μs 0.05 ± 0 μs 1 ± 0
overhead/acrule/noop:Sym 0.051 ± 0.01 μs 0.06 ± 0.01 μs 0.85 ± 0.22
overhead/get_degrees/large_poly 0.08 ± 0.001 μs 0.08 ± 0.01 μs 1 ± 0.13
overhead/rule/noop:Int 0.06 ± 0.01 μs 0.06 ± 0.01 μs 1 ± 0.24
overhead/rule/noop:Sym 0.06 ± 0.001 μs 0.06 ± 0.001 μs 1 ± 0.024
overhead/rule/noop:Term 0.06 ± 0.001 μs 0.06 ± 0.001 μs 1 ± 0.024
overhead/ruleset/noop:Int 30 ± 0 ns 30 ± 0 ns 1 ± 0
overhead/ruleset/noop:Sym 0.231 ± 0.01 μs 0.24 ± 0.001 μs 0.963 ± 0.042
overhead/ruleset/noop:Term 1.04 ± 0.029 μs 1.03 ± 0.03 μs 1.01 ± 0.041
overhead/simplify/noop:Int 30 ± 0 ns 30 ± 0 ns 1 ± 0
overhead/simplify/noop:Sym 0.04 ± 0.01 μs 0.04 ± 0.01 μs 1 ± 0.35
overhead/simplify/noop:Term 29.8 ± 2.1 μs 29.9 ± 1.4 μs 0.997 ± 0.083
overhead/simplify/randterm (+, *):serial 0.289 ± 0.01 s 0.277 ± 0.01 s 1.04 ± 0.054
overhead/simplify/randterm (+, *):thread 0.318 ± 0.013 s 0.303 ± 0.011 s 1.05 ± 0.059
overhead/simplify/randterm (/, *):serial 0.18 ± 0.012 ms 0.173 ± 0.01 ms 1.04 ± 0.093
overhead/simplify/randterm (/, *):thread 0.183 ± 0.011 ms 0.175 ± 0.01 ms 1.04 ± 0.088
overhead/substitute/a 0.0401 ± 0.00094 ms 0.0392 ± 0.0008 ms 1.02 ± 0.032
overhead/substitute/a,b 0.0479 ± 0.00097 ms 0.0468 ± 0.00086 ms 1.02 ± 0.028
overhead/substitute/a,b,c 0.0431 ± 0.00083 ms 0.0423 ± 0.0008 ms 1.02 ± 0.028
polyform/easy_iszero 22.6 ± 0.55 μs 22.2 ± 0.62 μs 1.02 ± 0.038
polyform/isone 1.05 ± 0.041 ms 1.03 ± 0.04 ms 1.01 ± 0.056
polyform/isone:noop 0.08 ± 0 μs 0.08 ± 0 μs 1 ± 0
polyform/iszero 0.879 ± 0.035 ms 0.894 ± 0.079 ms 0.983 ± 0.095
polyform/iszero:noop 0.081 ± 0.01 μs 0.08 ± 0.001 μs 1.01 ± 0.13
polyform/simplify_fractions 1.13 ± 0.047 ms 1.13 ± 0.087 ms 1.01 ± 0.088
printing/large_poly 0.225 ± 0.0024 s 0.223 ± 0.0019 s 1.01 ± 0.014
time_to_load 1.6 ± 0.021 s 1.61 ± 0.016 s 0.99 ± 0.016
Memory benchmarks
master f705847... master / f705847...
arithmetic/2-arg mul 0.078 k allocs: 2.72 kB 0.078 k allocs: 2.72 kB 1
arithmetic/addition 0.468 k allocs: 16.9 kB 0.468 k allocs: 16.9 kB 1
arithmetic/division 0.142 k allocs: 5.47 kB 0.142 k allocs: 5.47 kB 1
arithmetic/multiplication 0.356 k allocs: 11.7 kB 0.356 k allocs: 11.7 kB 1
codegen/arrayop_nested/fast_toexpr 0.189 k allocs: 11.2 kB 0.189 k allocs: 11.2 kB 1
codegen/arrayop_nested/toexpr 0.474 k allocs: 20.6 kB 0.474 k allocs: 20.6 kB 1
codegen/deep_poly/deg=10:fast_toexpr 0.975 k allocs: 0.0564 MB 0.927 k allocs: 0.0542 MB 1.04
codegen/deep_poly/deg=10:toexpr 1.05 k allocs: 0.0497 MB 1.05 k allocs: 0.0497 MB 1
codegen/deep_poly/deg=14:fast_toexpr 1.71 k allocs: 0.117 MB 1.61 k allocs: 0.108 MB 1.09
codegen/deep_poly/deg=14:toexpr 1.88 k allocs: 0.0929 MB 1.88 k allocs: 0.0929 MB 1
codegen/deep_poly/deg=6:fast_toexpr 0.447 k allocs: 31.4 kB 0.423 k allocs: 30.3 kB 1.04
codegen/deep_poly/deg=6:toexpr 0.448 k allocs: 22.9 kB 0.448 k allocs: 22.9 kB 1
codegen/makearray/n=100:fast_toexpr 1.34 k allocs: 0.0702 MB 1.17 k allocs: 0.0626 MB 1.12
codegen/makearray/n=100:toexpr 4.43 k allocs: 0.174 MB 4.43 k allocs: 0.174 MB 1
codegen/makearray/n=200:fast_toexpr 2.37 k allocs: 0.118 MB 2.16 k allocs: 0.109 MB 1.08
codegen/makearray/n=200:toexpr 6.36 k allocs: 0.246 MB 6.36 k allocs: 0.246 MB 1
codegen/makearray/n=400:fast_toexpr 4.21 k allocs: 0.213 MB 3.94 k allocs: 0.203 MB 1.05
codegen/makearray/n=400:toexpr 10.2 k allocs: 0.392 MB 10.2 k allocs: 0.392 MB 1
codegen/wide_deep_poly/fast_toexpr 5.56 k allocs: 0.3 MB 5.44 k allocs: 0.295 MB 1.02
codegen/wide_deep_poly/toexpr 6.88 k allocs: 0.319 MB 6.88 k allocs: 0.319 MB 1
codegen/wide_poly/n=100:fast_toexpr 2.98 k allocs: 0.178 MB 2.58 k allocs: 0.16 MB 1.11
codegen/wide_poly/n=100:toexpr 3.92 k allocs: 0.168 MB 3.92 k allocs: 0.168 MB 1
codegen/wide_poly/n=25:fast_toexpr 0.779 k allocs: 0.0464 MB 0.679 k allocs: 0.0418 MB 1.11
codegen/wide_poly/n=25:toexpr 0.992 k allocs: 0.0428 MB 0.992 k allocs: 0.0428 MB 1
codegen/wide_poly/n=50:fast_toexpr 1.52 k allocs: 0.109 MB 1.32 k allocs: 0.0942 MB 1.16
codegen/wide_poly/n=50:toexpr 1.97 k allocs: 0.0883 MB 1.97 k allocs: 0.0883 MB 1
irstructure/search_variables/common:IRStructure 0.06 k allocs: 7.03 kB 0.06 k allocs: 7.03 kB 1
irstructure/search_variables/common:reference 5.81 k allocs: 0.0887 MB 5.81 k allocs: 0.0887 MB 1
irstructure/search_variables/dissimilar:IRStructure 0.049 k allocs: 5.27 kB 0.049 k allocs: 5.27 kB 1
irstructure/search_variables/dissimilar:reference 1.21 k allocs: 18.9 kB 1.21 k allocs: 18.9 kB 1
irstructure/substitute/IRSubstituter 0.0399 M allocs: 1.46 MB 0.0399 M allocs: 1.46 MB 1
irstructure/substitute/reference 0.0452 M allocs: 1.66 MB 0.0452 M allocs: 1.66 MB 1
irstructure/substitute/sparse IRSubstituter 4.7 k allocs: 0.174 MB 4.7 k allocs: 0.174 MB 1
irstructure/substitute/sparse reference 10 k allocs: 0.381 MB 10 k allocs: 0.381 MB 1
overhead/acrule/a+2 0.034 k allocs: 1.25 kB 0.034 k allocs: 1.25 kB 1
overhead/acrule/a+2+b 0 allocs: 0 B 0 allocs: 0 B
overhead/acrule/a+b 0.047 k allocs: 1.8 kB 0.047 k allocs: 1.8 kB 1
overhead/acrule/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/acrule/noop:Sym 0 allocs: 0 B 0 allocs: 0 B
overhead/get_degrees/large_poly 2 allocs: 32 B 2 allocs: 32 B 1
overhead/rule/noop:Int 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/rule/noop:Sym 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/rule/noop:Term 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/ruleset/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/ruleset/noop:Sym 3 allocs: 0.109 kB 3 allocs: 0.109 kB 1
overhead/ruleset/noop:Term 12 allocs: 0.391 kB 12 allocs: 0.391 kB 1
overhead/simplify/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/simplify/noop:Sym 0 allocs: 0 B 0 allocs: 0 B
overhead/simplify/noop:Term 0.298 k allocs: 11.5 kB 0.298 k allocs: 11.5 kB 1
overhead/simplify/randterm (+, *):serial 2.54 M allocs: 0.0973 GB 2.55 M allocs: 0.0974 GB 0.999
overhead/simplify/randterm (+, *):thread 2.6 M allocs: 0.255 GB 2.6 M allocs: 0.255 GB 1
overhead/simplify/randterm (/, *):serial 2.04 k allocs: 0.0733 MB 2.04 k allocs: 0.0733 MB 1
overhead/simplify/randterm (/, *):thread 2.07 k allocs: 0.0743 MB 2.07 k allocs: 0.0743 MB 1
overhead/substitute/a 0.233 k allocs: 8.62 kB 0.233 k allocs: 8.62 kB 1
overhead/substitute/a,b 0.28 k allocs: 10.3 kB 0.28 k allocs: 10.3 kB 1
overhead/substitute/a,b,c 0.25 k allocs: 8.8 kB 0.25 k allocs: 8.8 kB 1
polyform/easy_iszero 0.133 k allocs: 4.58 kB 0.133 k allocs: 4.58 kB 1
polyform/isone 8.28 k allocs: 0.569 MB 8.28 k allocs: 0.569 MB 1
polyform/isone:noop 1 allocs: 16 B 1 allocs: 16 B 1
polyform/iszero 6.86 k allocs: 0.474 MB 6.86 k allocs: 0.474 MB 1
polyform/iszero:noop 1 allocs: 16 B 1 allocs: 16 B 1
polyform/simplify_fractions 8.76 k allocs: 0.592 MB 8.76 k allocs: 0.592 MB 1
printing/large_poly 1.86 M allocs: 0.082 GB 1.86 M allocs: 0.082 GB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 12, 2026

Benchmark Results (Julia v1)

Time benchmarks
master f705847... master / f705847...
arithmetic/2-arg mul 10.6 ± 0.29 μs 10.6 ± 0.28 μs 0.994 ± 0.038
arithmetic/addition 0.0688 ± 0.001 ms 0.0689 ± 0.001 ms 0.998 ± 0.021
arithmetic/division 24.9 ± 0.58 μs 24.5 ± 0.55 μs 1.02 ± 0.033
arithmetic/multiplication 0.0525 ± 0.0021 ms 0.0513 ± 0.002 ms 1.02 ± 0.057
codegen/arrayop_nested/fast_toexpr 7.71 ± 0.44 μs 7.75 ± 0.42 μs 0.995 ± 0.078
codegen/arrayop_nested/toexpr 0.0563 ± 0.0019 ms 0.0557 ± 0.0015 ms 1.01 ± 0.044
codegen/deep_poly/deg=10:fast_toexpr 0.0718 ± 0.018 ms 0.0688 ± 0.018 ms 1.04 ± 0.38
codegen/deep_poly/deg=10:toexpr 0.0663 ± 0.019 ms 0.066 ± 0.018 ms 1 ± 0.41
codegen/deep_poly/deg=14:fast_toexpr 0.166 ± 0.029 ms 0.155 ± 0.023 ms 1.07 ± 0.24
codegen/deep_poly/deg=14:toexpr 0.122 ± 0.036 ms 0.12 ± 0.035 ms 1.01 ± 0.42
codegen/deep_poly/deg=6:fast_toexpr 30.8 ± 4.5 μs 28.5 ± 3.6 μs 1.08 ± 0.21
codegen/deep_poly/deg=6:toexpr 28.1 ± 0.79 μs 28.2 ± 0.83 μs 0.998 ± 0.041
codegen/makearray/n=100:fast_toexpr 0.121 ± 0.036 ms 0.0994 ± 0.034 ms 1.22 ± 0.55
codegen/makearray/n=100:toexpr 0.58 ± 0.078 ms 0.572 ± 0.071 ms 1.01 ± 0.19
codegen/makearray/n=200:fast_toexpr 0.184 ± 0.049 ms 0.141 ± 0.045 ms 1.31 ± 0.54
codegen/makearray/n=200:toexpr 0.989 ± 0.14 ms 0.973 ± 0.13 ms 1.02 ± 0.2
codegen/makearray/n=400:fast_toexpr 0.34 ± 0.055 ms 0.286 ± 0.051 ms 1.19 ± 0.29
codegen/makearray/n=400:toexpr 1.63 ± 0.24 ms 1.59 ± 0.24 ms 1.02 ± 0.22
codegen/wide_deep_poly/fast_toexpr 0.638 ± 0.029 ms 0.601 ± 0.025 ms 1.06 ± 0.065
codegen/wide_deep_poly/toexpr 0.446 ± 0.018 ms 0.442 ± 0.017 ms 1.01 ± 0.057
codegen/wide_poly/n=100:fast_toexpr 0.247 ± 0.021 ms 0.206 ± 0.017 ms 1.2 ± 0.14
codegen/wide_poly/n=100:toexpr 0.258 ± 0.019 ms 0.26 ± 0.05 ms 0.993 ± 0.21
codegen/wide_poly/n=25:fast_toexpr 0.0448 ± 0.017 ms 0.0397 ± 0.015 ms 1.13 ± 0.61
codegen/wide_poly/n=25:toexpr 0.0615 ± 0.017 ms 0.0631 ± 0.017 ms 0.974 ± 0.38
codegen/wide_poly/n=50:fast_toexpr 0.113 ± 0.022 ms 0.0907 ± 0.012 ms 1.24 ± 0.3
codegen/wide_poly/n=50:toexpr 0.127 ± 0.035 ms 0.127 ± 0.034 ms 1 ± 0.38
irstructure/search_variables/common:IRStructure 0.235 ± 0.0092 ms 0.227 ± 0.0051 ms 1.03 ± 0.047
irstructure/search_variables/common:reference 1.46 ± 0.068 ms 1.53 ± 0.062 ms 0.954 ± 0.059
irstructure/search_variables/dissimilar:IRStructure 0.0634 ± 0.0023 ms 0.0665 ± 0.0017 ms 0.954 ± 0.043
irstructure/search_variables/dissimilar:reference 0.322 ± 0.012 ms 0.339 ± 0.013 ms 0.951 ± 0.049
irstructure/substitute/IRSubstituter 8.27 ± 1.1 ms 7.42 ± 0.2 ms 1.11 ± 0.16
irstructure/substitute/reference 8.78 ± 0.86 ms 8.21 ± 0.99 ms 1.07 ± 0.17
irstructure/substitute/sparse IRSubstituter 1.2 ± 0.028 ms 1.2 ± 0.027 ms 1.01 ± 0.033
irstructure/substitute/sparse reference 1.69 ± 0.046 ms 1.67 ± 0.03 ms 1.01 ± 0.033
overhead/acrule/a+2 2.23 ± 0.08 μs 2.26 ± 0.091 μs 0.987 ± 0.053
overhead/acrule/a+2+b 0.07 ± 0.001 μs 0.07 ± 0.01 μs 1 ± 0.14
overhead/acrule/a+b 3.87 ± 0.13 μs 3.95 ± 0.18 μs 0.98 ± 0.055
overhead/acrule/noop:Int 30 ± 0 ns 30 ± 0 ns 1 ± 0
overhead/acrule/noop:Sym 0.06 ± 0 μs 0.06 ± 0 μs 1 ± 0
overhead/get_degrees/large_poly 0.07 ± 0.01 μs 0.07 ± 0.001 μs 1 ± 0.14
overhead/rule/noop:Int 0.061 ± 0.01 μs 0.06 ± 0.01 μs 1.02 ± 0.24
overhead/rule/noop:Sym 0.07 ± 0.01 μs 0.061 ± 0.01 μs 1.15 ± 0.25
overhead/rule/noop:Term 0.07 ± 0.01 μs 0.06 ± 0.01 μs 1.17 ± 0.26
overhead/ruleset/noop:Int 30 ± 0 ns 30 ± 0 ns 1 ± 0
overhead/ruleset/noop:Sym 0.32 ± 0.01 μs 0.31 ± 0.001 μs 1.03 ± 0.032
overhead/ruleset/noop:Term 1.14 ± 0.032 μs 1.18 ± 0.029 μs 0.967 ± 0.036
overhead/simplify/noop:Int 30 ± 0 ns 30 ± 0 ns 1 ± 0
overhead/simplify/noop:Sym 30 ± 10 ns 30 ± 10 ns 1 ± 0.47
overhead/simplify/noop:Term 27.7 ± 0.64 μs 27.8 ± 0.68 μs 0.995 ± 0.034
overhead/simplify/randterm (+, *):serial 0.233 ± 0.029 s 0.238 ± 0.034 s 0.979 ± 0.18
overhead/simplify/randterm (+, *):thread 0.291 ± 0.023 s 0.291 ± 0.024 s 0.999 ± 0.11
overhead/simplify/randterm (/, *):serial 0.171 ± 0.022 ms 0.173 ± 0.023 ms 0.988 ± 0.19
overhead/simplify/randterm (/, *):thread 0.183 ± 0.027 ms 0.183 ± 0.024 ms 0.999 ± 0.2
overhead/substitute/a 0.034 ± 0.00088 ms 0.0339 ± 0.00089 ms 1 ± 0.037
overhead/substitute/a,b 0.0414 ± 0.0009 ms 0.0423 ± 0.0013 ms 0.978 ± 0.037
overhead/substitute/a,b,c 0.0402 ± 0.00098 ms 0.0405 ± 0.00099 ms 0.99 ± 0.034
polyform/easy_iszero 18.8 ± 0.39 μs 18.9 ± 0.35 μs 0.993 ± 0.028
polyform/isone 0.92 ± 0.03 ms 0.928 ± 0.021 ms 0.991 ± 0.04
polyform/isone:noop 0.07 ± 0.001 μs 0.07 ± 0.001 μs 1 ± 0.02
polyform/iszero 0.809 ± 0.027 ms 0.807 ± 0.02 ms 1 ± 0.042
polyform/iszero:noop 0.07 ± 0.01 μs 0.07 ± 0.001 μs 1 ± 0.14
polyform/simplify_fractions 0.992 ± 0.022 ms 1 ± 0.021 ms 0.989 ± 0.03
printing/large_poly 0.202 ± 0.019 s 0.185 ± 0.019 s 1.09 ± 0.15
time_to_load 1.73 ± 0.03 s 1.73 ± 0.013 s 0.998 ± 0.019
Memory benchmarks
master f705847... master / f705847...
arithmetic/2-arg mul 0.056 k allocs: 1.78 kB 0.056 k allocs: 1.78 kB 1
arithmetic/addition 0.33 k allocs: 11.3 kB 0.33 k allocs: 11.3 kB 1
arithmetic/division 0.132 k allocs: 4.77 kB 0.132 k allocs: 4.77 kB 1
arithmetic/multiplication 0.252 k allocs: 6.5 kB 0.252 k allocs: 6.5 kB 1
codegen/arrayop_nested/fast_toexpr 0.203 k allocs: 9.53 kB 0.203 k allocs: 9.53 kB 1
codegen/arrayop_nested/toexpr 0.527 k allocs: 19.8 kB 0.527 k allocs: 19.8 kB 1
codegen/deep_poly/deg=10:fast_toexpr 1.25 k allocs: 0.0565 MB 1.19 k allocs: 0.0545 MB 1.04
codegen/deep_poly/deg=10:toexpr 1.41 k allocs: 0.0488 MB 1.41 k allocs: 0.0488 MB 1
codegen/deep_poly/deg=14:fast_toexpr 2.22 k allocs: 0.12 MB 2.1 k allocs: 0.116 MB 1.03
codegen/deep_poly/deg=14:toexpr 2.55 k allocs: 0.0908 MB 2.55 k allocs: 0.0908 MB 1
codegen/deep_poly/deg=6:fast_toexpr 0.561 k allocs: 28.9 kB 0.531 k allocs: 27.9 kB 1.04
codegen/deep_poly/deg=6:toexpr 0.6 k allocs: 22.2 kB 0.6 k allocs: 22.2 kB 1
codegen/makearray/n=100:fast_toexpr 1.97 k allocs: 0.0834 MB 1.8 k allocs: 0.0776 MB 1.07
codegen/makearray/n=100:toexpr 4.93 k allocs: 0.17 MB 4.93 k allocs: 0.17 MB 1
codegen/makearray/n=200:fast_toexpr 3.21 k allocs: 0.135 MB 2.92 k allocs: 0.126 MB 1.07
codegen/makearray/n=200:toexpr 8.51 k allocs: 0.293 MB 8.51 k allocs: 0.293 MB 1
codegen/makearray/n=400:fast_toexpr 6.31 k allocs: 0.268 MB 5.93 k allocs: 0.256 MB 1.05
codegen/makearray/n=400:toexpr 14.1 k allocs: 0.477 MB 14.1 k allocs: 0.477 MB 1
codegen/wide_deep_poly/fast_toexpr 7.43 k allocs: 0.352 MB 7.28 k allocs: 0.347 MB 1.02
codegen/wide_deep_poly/toexpr 9.37 k allocs: 0.327 MB 9.37 k allocs: 0.327 MB 1
codegen/wide_poly/n=100:fast_toexpr 3.5 k allocs: 0.155 MB 3 k allocs: 0.137 MB 1.13
codegen/wide_poly/n=100:toexpr 4.92 k allocs: 0.166 MB 4.92 k allocs: 0.166 MB 1
codegen/wide_poly/n=25:fast_toexpr 0.911 k allocs: 0.0388 MB 0.786 k allocs: 0.0346 MB 1.12
codegen/wide_poly/n=25:toexpr 1.24 k allocs: 0.0421 MB 1.24 k allocs: 0.0421 MB 1
codegen/wide_poly/n=50:fast_toexpr 1.78 k allocs: 0.0928 MB 1.53 k allocs: 0.084 MB 1.1
codegen/wide_poly/n=50:toexpr 2.47 k allocs: 0.0862 MB 2.47 k allocs: 0.0862 MB 1
irstructure/search_variables/common:IRStructure 0.09 k allocs: 6.25 kB 0.09 k allocs: 6.25 kB 1
irstructure/search_variables/common:reference 5.81 k allocs: 0.0887 MB 5.81 k allocs: 0.0887 MB 1
irstructure/search_variables/dissimilar:IRStructure 0.073 k allocs: 5.33 kB 0.073 k allocs: 5.33 kB 1
irstructure/search_variables/dissimilar:reference 1.21 k allocs: 18.9 kB 1.21 k allocs: 18.9 kB 1
irstructure/substitute/IRSubstituter 0.0327 M allocs: 1.06 MB 0.0327 M allocs: 1.06 MB 1
irstructure/substitute/reference 0.0353 M allocs: 1.23 MB 0.0353 M allocs: 1.23 MB 1
irstructure/substitute/sparse IRSubstituter 3.81 k allocs: 0.126 MB 3.81 k allocs: 0.126 MB 1
irstructure/substitute/sparse reference 6.49 k allocs: 0.293 MB 6.49 k allocs: 0.293 MB 1
overhead/acrule/a+2 0.034 k allocs: 1.12 kB 0.034 k allocs: 1.12 kB 1
overhead/acrule/a+2+b 0 allocs: 0 B 0 allocs: 0 B
overhead/acrule/a+b 0.046 k allocs: 1.55 kB 0.046 k allocs: 1.55 kB 1
overhead/acrule/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/acrule/noop:Sym 0 allocs: 0 B 0 allocs: 0 B
overhead/get_degrees/large_poly 2 allocs: 32 B 2 allocs: 32 B 1
overhead/rule/noop:Int 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/rule/noop:Sym 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/rule/noop:Term 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
overhead/ruleset/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/ruleset/noop:Sym 3 allocs: 0.109 kB 3 allocs: 0.109 kB 1
overhead/ruleset/noop:Term 12 allocs: 0.391 kB 12 allocs: 0.391 kB 1
overhead/simplify/noop:Int 0 allocs: 0 B 0 allocs: 0 B
overhead/simplify/noop:Sym 0 allocs: 0 B 0 allocs: 0 B
overhead/simplify/noop:Term 0.284 k allocs: 9.91 kB 0.284 k allocs: 9.91 kB 1
overhead/simplify/randterm (+, *):serial 2.39 M allocs: 0.0829 GB 2.39 M allocs: 0.0829 GB 0.999
overhead/simplify/randterm (+, *):thread 2.55 M allocs: 0.245 GB 2.55 M allocs: 0.245 GB 1
overhead/simplify/randterm (/, *):serial 1.91 k allocs: 0.0655 MB 1.91 k allocs: 0.0655 MB 1
overhead/simplify/randterm (/, *):thread 2.05 k allocs: 0.0704 MB 2.05 k allocs: 0.0704 MB 1
overhead/substitute/a 0.172 k allocs: 6.05 kB 0.172 k allocs: 6.05 kB 1
overhead/substitute/a,b 0.223 k allocs: 7.69 kB 0.223 k allocs: 7.69 kB 1
overhead/substitute/a,b,c 0.229 k allocs: 7.81 kB 0.229 k allocs: 7.81 kB 1
polyform/easy_iszero 0.092 k allocs: 2.94 kB 0.092 k allocs: 2.94 kB 1
polyform/isone 10.9 k allocs: 0.574 MB 10.9 k allocs: 0.574 MB 1
polyform/isone:noop 1 allocs: 16 B 1 allocs: 16 B 1
polyform/iszero 8.96 k allocs: 0.48 MB 8.96 k allocs: 0.48 MB 1
polyform/iszero:noop 1 allocs: 16 B 1 allocs: 16 B 1
polyform/simplify_fractions 11.3 k allocs: 0.591 MB 11.3 k allocs: 0.591 MB 1
printing/large_poly 2.15 M allocs: 0.079 GB 2.15 M allocs: 0.079 GB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

CSEin constants makes variables much more connected to each other than they are in reality making it harder to decouplt them into e.g. separate functions at a later stage
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