JuliaSyntax.jl icon indicating copy to clipboard operation
JuliaSyntax.jl copied to clipboard

>500x runtime slowdown from hashing changes in #452

Open ericphanson opened this issue 5 months ago • 4 comments

#452 seems to have regressed runtime in ExplicitImports quite a bit

On the parent commit f425045d56f75c71493aba77e1b751f69f552e48 I get

julia> using ExplicitImports

julia> @time explicit_imports(ExplicitImports);
  0.196597 seconds (922.30 k allocations: 37.488 MiB, 46.57% gc time, 12.30% compilation time)

julia> @time explicit_imports(ExplicitImports);
  0.076680 seconds (921.33 k allocations: 37.444 MiB)

julia> @time explicit_imports(ExplicitImports);
  0.145795 seconds (921.33 k allocations: 37.444 MiB, 45.09% gc time)

julia> @time explicit_imports(ExplicitImports);
  0.077001 seconds (921.33 k allocations: 37.444 MiB)

on 8a123a13d0da2e99f9f98ed9006aeb16f2e3b4d0 I get

julia> using ExplicitImports

julia> @time explicit_imports(ExplicitImports);
116.010345 seconds (1.34 G allocations: 25.114 GiB, 0.98% gc time, 0.02% compilation time)

julia> @time explicit_imports(ExplicitImports);
115.139176 seconds (1.34 G allocations: 25.114 GiB, 1.07% gc time)

I used the SIGINFO profiling tool on JuliaSyntax v1.0.2 to see why it was so slow, which is what led me to the hashing and thus that PR. I've included that profile below.

Profiling
julia> print_explicit_imports(ExplicitImports)
load: 3.42  cmd: julia 45867 running 12.07u 0.22s

======================================================================================
Information request received. A stacktrace will print followed by a 1.0 second profile
======================================================================================

signal (29): Information request: 29
__psynch_cvwait at /usr/lib/system/libsystem_kernel.dylib (unknown line)
unknown function (ip: 0x0)
__psynch_cvwait at /usr/lib/system/libsystem_kernel.dylib (unknown line)
unknown function (ip: 0x0)
__psynch_cvwait at /usr/lib/system/libsystem_kernel.dylib (unknown line)
unknown function (ip: 0x0)
__psynch_cvwait at /usr/lib/system/libsystem_kernel.dylib (unknown line)
unknown function (ip: 0x0)
MurmurHash3_x64_128 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/support/MurmurHash3.c:242
memhash_seed at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/support/hashing.c:74
hash at ./strings/substring.jl:140 [inlined]
hash at ./tuple.jl:583
jfptr_hash_6501 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/source_files.jl:146
hash at ./tuple.jl:583
jfptr_hash_6494 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:53
hash at ./tuple.jl:583 [inlined]
hash at ./tuple.jl:583
jfptr_hash_6498 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583
jfptr_hash_6514 at /Users/eph/.julia/compiled/v1.11/ExplicitImports/kpiVf_oV9rA.dylib (unknown line)
hash at /Users/eph/.julia/packages/JuliaSyntax/J00sR/src/syntax_tree.jl:21
hash at ./abstractarray.jl:3550
hash at ./tuple.jl:583 [inlined]
hash at ./tuple.jl:583 [inlined]
hash at ./namedtuple.jl:253 [inlined]
hash at ./hashing.jl:28 [inlined]
hashindex at ./dict.jl:128 [inlined]
ht_keyindex at ./dict.jl:242
get at ./dict.jl:503 [inlined]
is_name_internal_in_higher_local_scope at /Users/eph/ExplicitImports/src/get_names_used.jl:505
#14 at /Users/eph/ExplicitImports/src/get_names_used.jl:567
iterate at ./generator.jl:48 [inlined]
collect_to! at ./array.jl:849 [inlined]
collect_to_with_first! at ./array.jl:827 [inlined]
_collect at ./array.jl:821
collect_similar at ./array.jl:720 [inlined]
map at ./abstractarray.jl:3371 [inlined]
analyze_per_usage_info at /Users/eph/ExplicitImports/src/get_names_used.jl:527 [inlined]
analyze_all_names at /Users/eph/ExplicitImports/src/get_names_used.jl:490
get_names_used at /Users/eph/ExplicitImports/src/get_names_used.jl:628
fill_cache! at /Users/eph/ExplicitImports/src/ExplicitImports.jl:375
#explicit_imports#141 at /Users/eph/ExplicitImports/src/ExplicitImports.jl:128
explicit_imports at /Users/eph/ExplicitImports/src/ExplicitImports.jl:116 [inlined]
#print_explicit_imports#61 at /Users/eph/ExplicitImports/src/interactive_usage.jl:69
print_explicit_imports at /Users/eph/ExplicitImports/src/interactive_usage.jl:42
#print_explicit_imports#60 at /Users/eph/ExplicitImports/src/interactive_usage.jl:2
print_explicit_imports at /Users/eph/ExplicitImports/src/interactive_usage.jl:1 [inlined]
print_explicit_imports at /Users/eph/ExplicitImports/src/interactive_usage.jl:1
unknown function (ip: 0x1301580df)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
do_call at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/interpreter.c:126
eval_stmt_value at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/interpreter.c:174
eval_body at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/interpreter.c:666
jl_interpret_toplevel_thunk at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/interpreter.c:824
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:943
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:886
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:886
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:886
ijl_toplevel_eval at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:952 [inlined]
ijl_toplevel_eval_in at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:994
eval at ./boot.jl:430 [inlined]
eval_user_input at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:261
repl_backend_loop at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:368
#start_repl_backend#59 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:343
start_repl_backend at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:340
#run_repl#76 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:500
run_repl at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:486
jfptr_run_repl_10112.1 at /Users/eph/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/compiled/v1.11/REPL/u0gqU_RnzCd.dylib (unknown line)
#1150 at ./client.jl:446
jfptr_YY.1150_14703.1 at /Users/eph/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/compiled/v1.11/REPL/u0gqU_RnzCd.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
jl_f__call_latest at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
run_main_repl at ./client.jl:430
repl_main at ./client.jl:567 [inlined]
_start at ./client.jl:541
jfptr__start_73721.1 at /Users/eph/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
true_main at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jlapi.c:900
jl_repl_entrypoint at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jlapi.c:1059
unknown function (ip: 0x0)

==============================================================
Profile collected. A report will print at the next yield point
==============================================================

  Module ExplicitImports is relying on implicit imports for 9 names. These could be explicitly
  imported as follows:

  using AbstractTrees: AbstractTrees, Leaves, TreeCursor, children, nodevalue
  using JuliaSyntax: JuliaSyntax, @K_str, SyntaxNode, parseall

  Additionally, module ExplicitImports explicitly imports 1 non-public name:

    •  parent is not public in AbstractTrees but it was imported from AbstractTrees at
       /Users/eph/ExplicitImports/src/ExplicitImports.jl:8:22

julia> ┌ Warning: There were no samples collected in one or more groups.
│ This may be due to idle threads, or you may need to run your
│ program longer (perhaps by running it multiple times),
│ or adjust the delay between samples with `Profile.init()`.
└ @ Profile ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Profile/src/Profile.jl:1240
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
Thread 1 Task 0x000000010a02c010 Total snapshots: 575. Utilization: 100%
  ╎539 @Base/client.jl:541; _start()
  ╎ 539 @Base/client.jl:567; repl_main
  ╎  539 @Base/client.jl:430; run_main_repl(interactive::Bool, quiet::Bool, banner::Symbol, histo…
  ╎   539 @Base/essentials.jl:1052; invokelatest
  ╎    539 @Base/essentials.jl:1055; #invokelatest#2
  ╎     539 @Base/client.jl:446; (::Base.var"#1150#1152"{Bool, Symbol, Bool})(REPL::Module)
  ╎    ╎ 539 @REPL/src/REPL.jl:486; run_repl(repl::REPL.AbstractREPL, consumer::Any)
  ╎    ╎  539 @REPL/src/REPL.jl:500; run_repl(repl::REPL.AbstractREPL, consumer::Any; backend_on_…
  ╎    ╎   539 @REPL/src/REPL.jl:340; kwcall(::NamedTuple, ::typeof(REPL.start_repl_backend), bac…
  ╎    ╎    539 @REPL/src/REPL.jl:343; start_repl_backend(backend::REPL.REPLBackend, consumer::An…
  ╎    ╎     539 @REPL/src/REPL.jl:368; repl_backend_loop(backend::REPL.REPLBackend, get_module::…
  ╎    ╎    ╎ 539 @REPL/src/REPL.jl:261; eval_user_input(ast::Any, backend::REPL.REPLBackend, mod…
64╎    ╎    ╎  539 @Base/boot.jl:430; eval
  ╎    ╎    ╎   475 …/src/interactive_usage.jl:1; print_explicit_imports(mod::Module)
  ╎    ╎    ╎    475 …/src/interactive_usage.jl:1; print_explicit_imports
  ╎    ╎    ╎     475 …/src/interactive_usage.jl:2; print_explicit_imports(mod::Module, file::Str…
  ╎    ╎    ╎    ╎ 475 …src/interactive_usage.jl:42; print_explicit_imports(final_io::Base.TTY, m…
  ╎    ╎    ╎    ╎  475 …rc/interactive_usage.jl:69; print_explicit_imports(final_io::Base.TTY, m…
  ╎    ╎    ╎    ╎   475 …/src/ExplicitImports.jl:116; explicit_imports
  ╎    ╎    ╎    ╎    475 …src/ExplicitImports.jl:128; explicit_imports(mod::Module, file::String…
  ╎    ╎    ╎    ╎     475 …src/ExplicitImports.jl:375; fill_cache!(file_analysis::Dict{String, E…
  ╎    ╎    ╎    ╎    ╎ 475 …src/get_names_used.jl:628; get_names_used(file::String)
  ╎    ╎    ╎    ╎    ╎  475 …src/get_names_used.jl:490; analyze_all_names(file::String)
  ╎    ╎    ╎    ╎    ╎   475 …src/get_names_used.jl:527; analyze_per_usage_info
  ╎    ╎    ╎    ╎    ╎    475 …ase/abstractarray.jl:3371; map
  ╎    ╎    ╎    ╎    ╎     475 @Base/array.jl:720; collect_similar
  ╎    ╎    ╎    ╎    ╎    ╎ 475 @Base/array.jl:821; _collect(c::Vector{@NamedTuple{name::Symbol,…
  ╎    ╎    ╎    ╎    ╎    ╎  475 @Base/array.jl:827; collect_to_with_first!
  ╎    ╎    ╎    ╎    ╎    ╎   475 @Base/array.jl:849; collect_to!
  ╎    ╎    ╎    ╎    ╎    ╎    475 @Base/generator.jl:48; iterate
  ╎    ╎    ╎    ╎    ╎    ╎     232 …/get_names_used.jl:528; (::ExplicitImports.var"#14#15"{Dict…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎ 232 @Base/dict.jl:549; in
  ╎    ╎    ╎    ╎    ╎    ╎    ╎  231 @Base/dict.jl:242; ht_keyindex(h::Dict{@NamedTuple{name::S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎   231 @Base/dict.jl:128; hashindex
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    231 @Base/hashing.jl:28; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎     231 …se/namedtuple.jl:253; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 231 @Base/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  231 @Base/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   231 …stractarray.jl:3550; hash(A::Vector{JuliaSyntax.Syn…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    231 …/syntax_tree.jl:21; hash(node::JuliaSyntax.SyntaxN…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     231 @Base/tuple.jl:583; hash(t::Tuple{Vector{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 225 …tractarray.jl:3550; hash(A::Vector{JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  225 …yntax_tree.jl:21; hash(node::JuliaSyntax.Syntax…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   225 @Base/tuple.jl:583; hash(t::Tuple{Vector{JuliaS…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    212 …ractarray.jl:3550; hash(A::Vector{JuliaSyntax…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     212 …ntax_tree.jl:21; hash(node::JuliaSyntax.Synt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ 212 …se/tuple.jl:583; hash(t::Tuple{Vector{Julia…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎  194 …actarray.jl:3550; hash(A::Vector{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎   194 …tax_tree.jl:21; hash(node::JuliaSyntax.Sy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    194 …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +1 173 …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +2 173 …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +3 173 …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +4 133 …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +5 133 …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +6 132 …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +7 113 …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +8 113 …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎ +9 113 …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +10 89  …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +11 89  …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +12 89  …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +13 67  …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +14 67  …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +15 66  …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +16 48  …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +17 48  …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +18 48  …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +19 37  …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +20 37  …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +21 37  …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +22 14  …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +23 14  …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +24 13  …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 9   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 9   …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 9   …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 7   …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 7   …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 6   …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 3   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 3   …tax_tree.jl:21; hash(node::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 3   …se/tuple.jl:583; hash(t::Tuple{Nothing, …
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 3   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 3   …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +36 3   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +37 3   …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +38 3   …se/tuple.jl:583; hash(t::Tuple{SubString…
 3╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +39 3   …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 3   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 3   …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 3   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 3   …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 3   …se/tuple.jl:583; hash(t::Tuple{SubString…
 3╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +36 3   …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 2   …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 2   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 2   …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 2   …se/tuple.jl:583; hash(t::Tuple{SubString…
 2╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 2   …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 4   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 4   …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 4   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 4   …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 4   …se/tuple.jl:583; hash(t::Tuple{SubString…
 3╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 3   …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 1   …actarray.jl:3550; hash(A::Vector{Int64},…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 1   …/hashing.jl:86; hash
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +36 1   @Base/int.jl:86; -
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +22 23  …se/tuple.jl:583; hash
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +23 23  …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +24 22  …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 2   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 2   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 2   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 2   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 2   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 2   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +36 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +37 2   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +38 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +39 2   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +40 2   …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +41 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +42 1   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +43 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +44 1   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +45 1   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +46 1   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +47 1   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +48 1   …/hashing.jl:36; hash
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +49 1   …flection.jl:741; objectid
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 20  …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 19  …se/tuple.jl:583; hash(t::Tuple{SubString…
15╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 15  …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 4   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 4   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 4   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 4   …se/tuple.jl:583; hash
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 1   …actarray.jl:0; hash(A::Vector{Int64}, h:…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 3   …actarray.jl:3550; hash(A::Vector{Int64},…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 3   …/hashing.jl:86; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 2   …/hashing.jl:77; hash_uint64
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 1   …/hashing.jl:44; hash_64_64
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 1   @Base/int.jl:321; ~
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 1   …/hashing.jl:49; hash_64_64
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 1   @Base/int.jl:373; xor
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 1   @Base/int.jl:1013; *
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 1   @Base/int.jl:88; *
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +19 11  …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +20 11  …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +21 11  …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +22 11  …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +23 11  …se/tuple.jl:583; hash(t::Tuple{SubString…
10╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +24 10  …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +24 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 1   …se/tuple.jl:583; hash
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 1   …se/array.jl:0; hash(A::Vector{Int64}, h:…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +16 18  …se/tuple.jl:583; hash
 2╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +17 18  …tax_tree.jl:53; hash(data::JuliaSyntax.S…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +18 16  …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +19 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +20 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +21 2   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +22 2   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +23 2   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +24 2   …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +25 2   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +26 1   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +27 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +28 1   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +29 1   …actarray.jl:3550; hash(A::Vector{JuliaSy…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +30 1   …een_tree.jl:75; hash(node::JuliaSyntax.G…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +31 1   …se/tuple.jl:583; hash(t::Tuple{JuliaSynt…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +32 1   …se/tuple.jl:583; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +33 1   …se/tuple.jl:583; hash(t::Tuple{Vector{Ju…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +34 1   …actarray.jl:3550; hash(A::Vector{JuliaSy…
 1╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +35 1   …een_tree.jl:75; hash(node::JuliaSyntax.G…
 3╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +19 14  …ce_files.jl:146; hash(s::JuliaSyntax.Sou…
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +20 11  …se/tuple.jl:583; hash(t::Tuple{SubString…
 8╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +21 8   …ubstring.jl:140; hash
  ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎    ╎     +21 3   …se/tuple.jl:583; hash
...

[truncated to fit in issue]

ericphanson avatar Jun 04 '25 22:06 ericphanson

Allocation regression would be fixed by https://github.com/JuliaLang/JuliaSyntax.jl/pull/559, but there still seem to remain the time regression.

aviatesk avatar Jun 05 '25 12:06 aviatesk

I guess you can get back the old behavior by using an IdDict instead of a Dict?

KristofferC avatar Jun 05 '25 13:06 KristofferC

that's a good idea, made a note here: https://github.com/ericphanson/ExplicitImports.jl/pull/109/files#r2128885216

ericphanson avatar Jun 05 '25 13:06 ericphanson

it turns out IdDict does not suffice for me since I have a Vector{SyntaxNode} and object identity on the vector is not what I want.

I think Keno's idea to weaken hashing (https://github.com/JuliaLang/JuliaSyntax.jl/pull/559#issuecomment-2953152307) sounds good since it should be non-breaking and recover performance (since hashes are allowed to collide more).

edit: In my code, I've reverted to object identity semantics with a wrapper:

struct SyntaxNodeList
    nodes::Vector{JuliaSyntax.SyntaxNode}
end

function Base.:(==)(a::SyntaxNodeList, b::SyntaxNodeList)
    return map(objectid, a.nodes) == map(objectid, b.nodes)
end
function Base.isequal(a::SyntaxNodeList, b::SyntaxNodeList)
    return isequal(map(objectid, a.nodes), map(objectid, b.nodes))
end

function Base.hash(a::SyntaxNodeList, h::UInt)
    return hash(map(objectid, a.nodes), h)
end

ericphanson avatar Jun 12 '25 21:06 ericphanson