Skip to content

Significantly increased number of allocations in v0.16.4 compared to v0.16.3 #425

Closed

Description

@Yue-Zhengyuan

I was doing SimpleUpdate benchmark tests using the current master branch of PEPSKit using the following script:

using Random
using TensorKit
using PEPSKit
using BenchmarkTools

Nr, Nc = 2, 2
ham = j1_j2_model(
    ComplexF64, Trivial, InfiniteSquare(Nr, Nc);
    J1 = 1.0, J2 = 0.0, sublattice = false
)
D = 8
Vvir = ℂ^D
state = InfinitePEPS(randn, ComplexF64, ℂ^2, Vvir; unitcell = (2, 2))
wts = SUWeight(state)
alg = SimpleUpdate(; trunc = truncrank(D))
evolver = TimeEvolver(state, ham, 0.1, 10, alg, wts)
circuit = evolver.gate

function test_suiter()
    return PEPSKit.su_iter(state, circuit, alg, wts)
end

@btime test_suiter()

Using TensorKit v0.16.4, the output is

13.033 ms (43992 allocations: 50.63 MiB)

If I downgrade to v0.16.3, I get

12.372 ms (25368 allocations: 49.86 MiB)

The number of allocations is almost 50% smaller with v0.16.3, though the speed change is not that dramatic. I haven't been able to produce a more minimal example. Is this something to worry about?


Environment details below:

Details

I'm using Julia 1.12.5, with:

  • Project.toml for v0.16.4
  [6e4b80f9] BenchmarkTools v1.8.0
  [bb1c41ca] MPSKit v0.13.10
  [ca635005] MPSKitModels v0.4.6
  [52969e89] PEPSKit v0.7.0 `../PEPSKit.jl`
  [07d1fe3e] TensorKit v0.16.4
  [41b62e7d] TensorKitTensors v0.2.4
  [37e2e46d] LinearAlgebra v1.12.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [8dfed614] Test v1.11.0
  • Project.toml for v0.16.3
  [6e4b80f9] BenchmarkTools v1.8.0
  [bb1c41ca] MPSKit v0.13.10
  [ca635005] MPSKitModels v0.4.6
  [52969e89] PEPSKit v0.7.0 `../PEPSKit.jl`
⌅ [07d1fe3e] TensorKit v0.16.3
  [41b62e7d] TensorKitTensors v0.2.4
  [37e2e46d] LinearAlgebra v1.12.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [8dfed614] Test v1.11.0

Activity

  1. lkdvos commented on May 1, 2026

    @lkdvos
    Member

    It is quite hard to gauge what is going on, since the number of allocations does not necessarily map directly to a performance regression. Since the whole cache management system got rewritten, it isn't odd that this is happening per se, since I think we now have to retrieve cache data in 2 steps, rather than in 1, and there is some allocations associated with that. If you have a more in-depth profile view it might be that we have a type instability somewhere, which is causing this?

  2. Yue-Zhengyuan commented on May 2, 2026

    @Yue-Zhengyuan
    MemberAuthor

    I came up with a more minimal code that benchmarks the "apply_gate" step in simple update.

    using BenchmarkTools
    using Profile
    using TensorKit
    
    function contract(
            a::AbstractTensorMap{T, S, 2, 1}, b::AbstractTensorMap{T, S, 2, 1},
            gate::AbstractTensorMap{T, S, 2, 2}
        ) where {T, S}
        return @tensor a2b2[-1 -2; -3 -4] := gate[-2 -3; 1 2] * a[-1 1 3] * b[3 2 -4]
    end
    
    Vp, Vv = ℂ^4, ℂ^10
    # P.S. if I use these, allocation number difference becomes much smaller.
    # Vp = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 2, (1, 1) => 1, (1, -1) => 1)
    # Vv = Vect[FermionParity ⊠ U1Irrep]((0, 0) => 4, (1, 1) => 2, (1, -1) => 2, (0, 2) => 1, (0, -2) => 1)
    a = randn(Vv ⊗ Vp ← Vv)
    b = randn(Vv ⊗ Vp ← Vv)
    gate = randn(Vp ⊗ Vp ← Vp ⊗ Vp)
    a2b2 = contract(a, b, gate)
    
    @btime contract($a, $b, $gate)
    Profile.Allocs.clear()
    Profile.Allocs.@profile sample_rate=1.0 contract(a, b, gate)
    
    results = Profile.Allocs.fetch()
    n_alloc = length(results.allocs)
    @info "Length of results.allocs = $(n_alloc)"
    for item in results.allocs
        println(item)
    end
    

    Good news is that if I increase the bond dimension, the relative differences in execution time and memory allocation of the two versions become smaller. So this is indeed caused by changes in bookkeeping code, instead of performance regression in contraction/decomposition that should scale with the bond dimension.

    Below is the output for v0.16.3

    Details
      30.750 μs (78 allocations: 168.50 KiB)
    [ Info: Length of results.allocs = 83
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 1, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 3, 2}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 51200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 3, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(Tuple{TensorMapSpace{ComplexSpace, 2, 2}, TensorMapSpace{ComplexSpace, 2, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 128)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 1}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 2048)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 1, 0, 0}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 3200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 1, 0, 0}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 51200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 1, 0, 0}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 3, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 1, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 2}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 12800)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Tuple{TensorMapSpace{ComplexSpace, 3, 2}, TensorMapSpace{ComplexSpace, 2, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 144)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 1}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 3200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 12800)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 4, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 5, FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.FusionBlockStructure{Trivial, 3, FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 1, 0, 0}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Core.MethodMatch, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Any}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Any}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Core.TypeMapEntry, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    

    and v0.16.5

    Details
      34.125 μs (142 allocations: 170.78 KiB)
    [ Info: Length of results.allocs = 147
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 1, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 3, 2}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 51200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 3, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(Tuple{TensorMapSpace{ComplexSpace, 2, 2}, TensorMapSpace{ComplexSpace, 2, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 128)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 1}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 2048)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 3200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 51200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 1, 0, 0}, FusionTree{Trivial, 2, 0, 1}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 3, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 96)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 1, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 2}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 12800)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Tuple{TensorMapSpace{ComplexSpace, 3, 2}, TensorMapSpace{ComplexSpace, 2, 1}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 144)
    Profile.Allocs.Alloc(TensorMapSpace{ComplexSpace, 2, 1}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 48)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 3200)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Profile.Allocs.BufferType, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 12800)
    Profile.Allocs.Alloc(Memory{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Float64}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.Hashed{TensorMapSpace{ComplexSpace, 3, 1}, typeof(TensorKit.sectorhash), typeof(TensorKit.sectorequal)}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(TensorKit.Hashed{TensorMapSpace{ComplexSpace, 3, 1}, typeof(TensorKit.sectorhash), typeof(TensorKit.sectorequal)}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 1, 0, 0}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{4}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 3, 1, 2}, FusionTree{Trivial, 2, 0, 1}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{5}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.Hashed{TensorMapSpace{ComplexSpace, 2, 1}, typeof(TensorKit.sectorhash), typeof(TensorKit.sectorequal)}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(TensorKit.Hashed{TensorMapSpace{ComplexSpace, 2, 1}, typeof(TensorKit.sectorhash), typeof(TensorKit.sectorequal)}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Dict{Trivial, Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Memory{UInt8}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Trivial}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Memory{Nothing}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(TensorKit.SectorStructure{Trivial, Tuple{FusionTree{Trivial, 2, 0, 1}, FusionTree{Trivial, 1, 0, 0}}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 16)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorKit.DegeneracyStructure{3}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Tuple{Any, Any}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(TensorMap{Float64, ComplexSpace, 2, 2, Vector{Float64}}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 80)
    Profile.Allocs.Alloc(Core.MethodMatch, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 32)
    Profile.Allocs.Alloc(Memory{Any}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Vector{Any}, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 24)
    Profile.Allocs.Alloc(Core.TypeMapEntry, Base.StackTraces.StackFrame[maybe_record_alloc_to_profile at gc-alloc-profiler.h:43 [inlined], ...], 64)
    

    I do see many Anys in both versions. Does it indicate type instability somewhere?

  3. Yue-Zhengyuan commented on May 2, 2026

    @Yue-Zhengyuan
    MemberAuthor

    In v0.16.3, there are 20 allocations of FusionBlockStructure.

    In #387, FusionBlockStructure is separated to SectorStructure and DegeneracyStructure. Here in v0.16.5, I observe 6 allocations of SectorStructure and 20 allocations of DegeneracyStructure.

    So naively the numbers don't add up.

  4. lkdvos commented on May 2, 2026

    @lkdvos
    Member

    Actually I think they might, this was the entire point: the sector structure is shared whenever only the degeneracy changes (that was the entire point), and so it should indeed cache less sector stuff than degeneracy stuff :)

  5. lkdvos commented on May 12, 2026

    @lkdvos
    Member

    Will close this for now since it seems like this is expected and the actual size allocated hasn't increased drastically, but happy to reopen if this turns out to be an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions