Closed tdotclare closed 4 years ago
This release substantially improves the typical rendering performance of Leaf on normal render calls where the AST storage adheres to SynchronousLeafCache
SynchronousLeafCache
adherents guarantee a non-future cache retrieval method if appropriate (eg, in-memory storage of the cache). This is currently an internal-only protocol that provides func retrieve(documentName: String) -> LeafAST?
as a blocking retrieval method as an alternative to an EventLoopFuture<LeafAST?>
return
In the typical use case where a call to LeafRenderer.render()
references a template that is already present in the AST cache, is fully resolved, and is flat, this substantially improves render speed by skipping future handling.
1.0.0rc-1.12
(current) and BlockingLeafCache
Branch | Min | Avg | Max | Avg Baseline | Avg CPU Time | CPU Baseline |
---|---|---|---|---|---|---|
1.0.0rc-1.12 | 10.4s | 10.52s | 11.4s | 100% | 3m 1s | 100% |
BlockingLeafCache | 4.27s | 4.72s | 5.14s | 44.83% | 1m 14s | 40.72% |
Branch | Min | Avg | Max | Avg Baseline | Avg CPU Time | CPU Baseline |
---|---|---|---|---|---|---|
1.0.0rc-1.12 | 9s | 9.66s | 10.61s | 100% | 2m 51s | 100% |
BlockingLeafCache | 4.43s | 4.82s | 5.17s | 49.9% | 1m 18s | 45.3% |
NOTE this is purely a pipeline measurement - the templates themselves are lightweight and require next to no time to serialize
LeafCache.load()
has been renamed LeafCache.retrieve()
for clarity.LeafAST
storage on LeafCache
have been removed.These changes are now available in 1.0.0-rc.1.13
This release substantially improves the rendering performance of Leaf on typical calls where the template is fully resolved and cached.
Performance Comparison
Linear
Random
NOTE this is purely a pipeline measurement - the templates used are lightweight and require near-zero time to serialize