Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 350 Bytes

function_cache.md

File metadata and controls

16 lines (11 loc) · 350 Bytes

function_cache

  • based on DefinedIndex
  • cache function results, especially useful for slow, cpu heavy functions
  • cache is stored in a file, so it can be reused between sessions and is multi-process, thread safe
from liteindex import function_cache

@function_cache
def slow_function(a, b):
    return a + b

slow_function(1, 2)