bytecode
xsdata.formats.dataclass.bytecode
MemoryBytecodeCache
Bases: BytecodeCache
In-memory jinja2 bytecode cache.
Every generator instance creates its own environment, because the filters depend on the generator config. Sharing the compiled templates across environments skips parsing and compiling them on every code generation run in the same process.
Buckets are keyed by the template name and filename, and jinja2 discards cached bytecode when the template source checksum changes.
Source code in xsdata/formats/dataclass/bytecode.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
load_bytecode(bucket)
Load the cached bytecode into the bucket, if any.
Source code in xsdata/formats/dataclass/bytecode.py
21 22 23 24 25 | |
dump_bytecode(bucket)
Store the bucket bytecode.
Source code in xsdata/formats/dataclass/bytecode.py
27 28 29 | |
clear()
Clear the cache.
Source code in xsdata/formats/dataclass/bytecode.py
31 32 33 | |