Open MilesCranmer opened 5 months ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
src/Strings.jl | 70 | 135 | 51.85% | ||
<!-- | Total: | 70 | 135 | 51.85% | --> |
Totals | |
---|---|
Change from base Build 7337169551: | -4.2% |
Covered Lines: | 1269 |
Relevant Lines: | 1409 |
master | 9cd35ffdf59628... | t[master]/t[9cd35ffdf59628...] | |
---|---|---|---|
eval/ComplexF32/evaluation | 7.37 ± 0.52 ms | 7.31 ± 0.46 ms | 1.01 |
eval/ComplexF64/evaluation | 9.58 ± 0.7 ms | 9.5 ± 0.64 ms | 1.01 |
eval/Float32/derivative | 10.5 ± 1.3 ms | 10.8 ± 1.3 ms | 0.972 |
eval/Float32/derivative_turbo | 12.1 ± 1.4 ms | 12.3 ± 1.3 ms | 0.986 |
eval/Float32/evaluation | 2.65 ± 0.24 ms | 2.62 ± 0.22 ms | 1.01 |
eval/Float32/evaluation_turbo | 0.618 ± 0.025 ms | 0.603 ± 0.026 ms | 1.02 |
eval/Float64/derivative | 13.7 ± 0.54 ms | 13.3 ± 0.55 ms | 1.03 |
eval/Float64/derivative_turbo | 14.5 ± 0.56 ms | 14.6 ± 0.54 ms | 0.992 |
eval/Float64/evaluation | 2.82 ± 0.24 ms | 2.82 ± 0.24 ms | 0.999 |
eval/Float64/evaluation_turbo | 1.12 ± 0.058 ms | 1.11 ± 0.059 ms | 1.01 |
utils/combine_operators/break_sharing | 0.0415 ± 0.0028 ms | 0.0409 ± 0.0026 ms | 1.01 |
utils/convert/break_sharing | 28.1 ± 0.56 μs | 28.4 ± 0.72 μs | 0.99 |
utils/convert/preserve_sharing | 0.127 ± 0.0025 ms | 0.128 ± 0.0026 ms | 0.995 |
utils/copy/break_sharing | 28.9 ± 0.58 μs | 28.6 ± 0.63 μs | 1.01 |
utils/copy/preserve_sharing | 0.128 ± 0.0027 ms | 0.127 ± 0.0025 ms | 1 |
utils/count_constants/break_sharing | 11.8 ± 0.22 μs | 10.8 ± 0.17 μs | 1.09 |
utils/count_constants/preserve_sharing | 0.11 ± 0.0023 ms | 0.111 ± 0.0023 ms | 0.997 |
utils/count_depth/break_sharing | 12.8 ± 0.22 μs | 12.7 ± 0.21 μs | 1 |
utils/count_nodes/break_sharing | 10.5 ± 0.18 μs | 10.1 ± 0.16 μs | 1.03 |
utils/count_nodes/preserve_sharing | 0.114 ± 0.0022 ms | 0.114 ± 0.0022 ms | 1 |
utils/get_set_constants!/break_sharing | 0.0539 ± 0.00088 ms | 0.0523 ± 0.00081 ms | 1.03 |
utils/get_set_constants!/preserve_sharing | 0.318 ± 0.0051 ms | 0.32 ± 0.0048 ms | 0.994 |
utils/has_constants/break_sharing | 4.47 ± 0.22 μs | 4.31 ± 0.21 μs | 1.04 |
utils/has_operators/break_sharing | 1.78 ± 0.017 μs | 1.77 ± 0.016 μs | 1 |
utils/hash/break_sharing | 30.4 ± 0.46 μs | 30 ± 0.48 μs | 1.01 |
utils/hash/preserve_sharing | 0.133 ± 0.0025 ms | 0.133 ± 0.0025 ms | 1 |
utils/index_constants/break_sharing | 27.5 ± 0.68 μs | 27.4 ± 0.76 μs | 1 |
utils/index_constants/preserve_sharing | 0.127 ± 0.0024 ms | 0.127 ± 0.0024 ms | 0.997 |
utils/is_constant/break_sharing | 5.51 ± 0.21 μs | 4.77 ± 0.22 μs | 1.16 |
utils/simplify_tree/break_sharing | 0.251 ± 0.02 ms | 0.248 ± 0.02 ms | 1.01 |
utils/simplify_tree/preserve_sharing | 0.377 ± 0.022 ms | 0.386 ± 0.022 ms | 0.977 |
utils/string_tree/break_sharing | 0.558 ± 0.011 ms | 0.582 ± 0.015 ms | 0.959 |
utils/string_tree/preserve_sharing | 0.693 ± 0.013 ms | 0.7 ± 0.022 ms | 0.99 |
time_to_load | 0.683 ± 0.0083 s | 0.701 ± 0.0079 s | 0.974 |
Say we create an expression:
Note that the normal behavior is to encapsulate with
{}
when a node is shared.However, we can print this with less redundancy with
pretty_string_graph
:which finds the shared nodes, assigns variable names based on their depth, and then prints the program in this hierarchical fashion.
This is only 2x slower than the regular
string_tree
method, so I'm considering have this as the default forGraphNode
types. For consistency I might need to prepend the=
to regular print statements though...Curious to hear your thoughts @AlCap23 @Vaibhavdixit02 @ChrisRackauckas! I played around with a few different ideas for how to visualize this in the REPL and this one seemed like a good option. But interested in more.