mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Add lru_cache for get_shader_code_from_file
This commit is contained in:
parent
7895a2cfee
commit
dddaef0e6c
1 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,8 @@ import re
|
|||
import moderngl
|
||||
import numpy as np
|
||||
|
||||
from functools import lru_cache
|
||||
|
||||
from manimlib.utils.directories import get_shader_dir
|
||||
from manimlib.utils.file_ops import find_file
|
||||
from manimlib.utils.iterables import resize_array
|
||||
|
@ -159,7 +161,7 @@ class ShaderWrapper(object):
|
|||
# For caching
|
||||
filename_to_code_map: dict[str, str] = {}
|
||||
|
||||
|
||||
@lru_cache(maxsize=12)
|
||||
def get_shader_code_from_file(filename: str) -> str | None:
|
||||
if not filename:
|
||||
return None
|
||||
|
|
Loading…
Add table
Reference in a new issue