Skip to content

redesign caches and clear/disable during tests #242

@Jutho

Description

@Jutho

Currently we have the following cache variables (I hope I am not missing any):

TensorKit.GLOBAL_FUSIONBLOCKSTRUCTURE_CACHE
TensorKit.treetransposercache
TensorKit.treebraidercache
TensorKit.treepermutercache
TensorKit.transposecache
TensorKit.braidcache

As well as the control flags

TensorKit.usebraidcache_abelian
TensorKit.usebraidcache_nonabelian
TensorKit.usetransposecache
TensorKit.usetreetransposercache
TensorKit.usetreebraidercache
TensorKit.usetreepermutercache

and

abstract type CacheStyle end
struct NoCache <: CacheStyle end
struct TaskLocalCache{D<:AbstractDict} <: CacheStyle end
struct GlobalLRUCache <: CacheStyle end

function CacheStyle(I::Type{<:Sector})
    return GlobalLRUCache()
end

fusionblockstructure(W::HomSpace) = fusionblockstructure(W, CacheStyle(sectortype(W)))

for the fusion blockstructure caches.

We should probably make this a bit more uniform. Importantly, we should disable or empty caches while running the tests, as they in the end collect close to a gigabyte of cached data, with probably only negative effects on the test performance.

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