Skip to content

1.0.4

Choose a tag to compare

@TotalTechGeek TotalTechGeek released this 29 Jan 01:59
· 24 commits to main since this release
cba8bb2

Info

While I know that no one really asked for this 😂 , this release squeezes additional performance out of the AST and further optimizes the templates in interpreted mode.

I'm seeing roughly a ~20% improvement for templates run in interpreted mode.

No code in this library changed, just updated to the latest JSON-Logic-Engine dependency.

Benchmarks

As always, benchmarks usually have some level of noise to them -- the compiled templates have not changed significantly, so if something is off +/- 5-10ms, don't worry, it's not a degradation there.

1 Million Iterations Benchmark
Handlebars Simple: 2047.42ms | 1.00x
Elastic Simple: 1369.53ms | 1.49x
JLE Interpreted Simple: 43.38ms | 47.20x
JLE Async Simple: 119.76ms | 17.10x
JLE Simple: 3.42ms | 599.38x
---
Handlebars SimpleEach: 2320.97ms | 1.00x
Elastic SimpleEach: 3438.75ms | 0.67x
JLE Interpreted SimpleEach: 325.29ms | 7.14x
JLE Async SimpleEach: 199.51ms | 11.63x
JLE SimpleEach: 74.11ms | 31.32x
---
Handlebars SimpleIf: 2178.68ms | 1.00x
Elastic SimpleIf: 1502.47ms | 1.45x
JLE Interpreted SimpleIf: 107.56ms | 20.26x
JLE Async SimpleIf: 112.58ms | 19.35x
JLE SimpleIf: 14.17ms | 153.74x
---
Handlebars SimpleIf (False): 2207.77ms | 1.00x
Elastic SimpleIf (False): 1509.37ms | 1.46x
JLE Interpreted SimpleIf (False): 110.10ms | 20.05x
JLE Async SimpleIf (False): 109.46ms | 20.17x
JLE SimpleIf (False): 17.19ms | 128.43x
---
Handlebars NestedIf: 2224.06ms | 1.00x
Elastic NestedIf: 1509.33ms | 1.47x
JLE Interpreted NestedIf: 109.88ms | 20.24x
JLE Async NestedIf: 117.87ms | 18.87x
JLE NestedIf: 15.77ms | 140.99x
---
Handlebars NestedIf (False): 2596.23ms | 1.00x
Elastic NestedIf (False): 2389.33ms | 1.09x
JLE Interpreted NestedIf (False): 156.63ms | 16.58x
JLE Async NestedIf (False): 114.95ms | 22.59x
JLE NestedIf (False): 17.87ms | 145.25x
---
Handlebars NestedIf (18): 2237.30ms | 1.00x
Elastic NestedIf (18): 1510.15ms | 1.48x
JLE Interpreted NestedIf (18): 117.30ms | 19.07x
JLE Async NestedIf (18): 115.56ms | 19.36x
JLE NestedIf (18): 16.61ms | 134.69x
---
Handlebars EachStatic: 2647.67ms | 1.00x
Elastic EachStatic: 5336.71ms | 0.50x
JLE Interpreted EachStatic: 19.51ms | 135.69x
JLE Async EachStatic: 112.31ms | 23.58x
JLE EachStatic: 13.62ms | 194.36x
---
Handlebars AddExampleWithTraversal: 3991.92ms | 1.00x
Elastic AddExampleWithTraversal: 6363.62ms | 0.63x
JLE Interpreted AddExampleWithTraversal: 530.61ms | 7.52x
JLE Async AddExampleWithTraversal: 291.89ms | 13.68x
JLE AddExampleWithTraversal: 195.40ms | 20.43x
---
Handlebars Example 1: 3434.19ms | 1.00x
Elastic Example 1: 12999.65ms | 0.26x
JLE Interpreted Example 1: 1363.16ms | 2.52x
JLE Async Example 1: 333.49ms | 10.30x
JLE Example 1: 226.36ms | 15.17x
---
Handlebars YAML: 7083.01ms | 1.00x
Elastic YAML: 20297.55ms | 0.35x
JLE Interpreted YAML: 2189.19ms | 3.24x
JLE Async YAML: 442.13ms | 16.02x
JLE YAML: 308.72ms | 22.94x
---
Handlebars Partials: 5095.43ms | 1.00x
Elastic Partials: 23770.26ms | 0.21x
JLE Interpreted Partials: 671.42ms | 7.59x
JLE Async Partials: 159.57ms | 31.93x
JLE Partials: 52.96ms | 96.21x
1 Iteration (Cold) Benchmark
Handlebars Simple: 3.17ms | 1.00x
Elastic Simple: 0.80ms | 3.99x
JLE Interpreted Simple: 0.07ms | 45.47x
JLE Async Simple: 0.46ms | 6.87x
JLE Simple: 0.14ms | 22.04x
---
Handlebars SimpleEach: 1.08ms | 1.00x
Elastic SimpleEach: 0.27ms | 4.04x
JLE Interpreted SimpleEach: 0.37ms | 2.89x
JLE Async SimpleEach: 0.17ms | 6.53x
JLE SimpleEach: 0.34ms | 3.22x
---
Handlebars SimpleIf: 0.65ms | 1.00x
Elastic SimpleIf: 0.14ms | 4.79x
JLE Interpreted SimpleIf: 0.17ms | 3.75x
JLE Async SimpleIf: 0.25ms | 2.60x
JLE SimpleIf: 0.23ms | 2.86x
---
Handlebars SimpleIf (False): 0.39ms | 1.00x
Elastic SimpleIf (False): 0.15ms | 2.65x
JLE Interpreted SimpleIf (False): 0.05ms | 7.95x
JLE Async SimpleIf (False): 0.06ms | 6.32x
JLE SimpleIf (False): 0.08ms | 5.13x
---
Handlebars NestedIf: 1.54ms | 1.00x
Elastic NestedIf: 0.27ms | 5.81x
JLE Interpreted NestedIf: 0.07ms | 21.24x
JLE Async NestedIf: 0.23ms | 6.60x
JLE NestedIf: 0.28ms | 5.58x
---
Handlebars NestedIf (False): 0.79ms | 1.00x
Elastic NestedIf (False): 0.32ms | 2.48x
JLE Interpreted NestedIf (False): 0.16ms | 4.90x
JLE Async NestedIf (False): 0.09ms | 9.21x
JLE NestedIf (False): 0.17ms | 4.49x
---
Handlebars NestedIf (18): 0.43ms | 1.00x
Elastic NestedIf (18): 0.13ms | 3.24x
JLE Interpreted NestedIf (18): 0.06ms | 7.21x
JLE Async NestedIf (18): 0.08ms | 5.70x
JLE NestedIf (18): 0.08ms | 5.18x
---
Handlebars EachStatic: 0.45ms | 1.00x
Elastic EachStatic: 0.58ms | 0.77x
JLE Interpreted EachStatic: 0.16ms | 2.87x
JLE Async EachStatic: 0.63ms | 0.71x
JLE EachStatic: 0.19ms | 2.34x
---
Handlebars AddExampleWithTraversal: 0.78ms | 1.00x
Elastic AddExampleWithTraversal: 0.41ms | 1.93x
JLE Interpreted AddExampleWithTraversal: 0.14ms | 5.60x
JLE Async AddExampleWithTraversal: 0.30ms | 2.60x
JLE AddExampleWithTraversal: 0.48ms | 1.63x
---
Handlebars Example 1: 1.03ms | 1.00x
Elastic Example 1: 0.56ms | 1.84x
JLE Interpreted Example 1: 0.33ms | 3.15x
JLE Async Example 1: 0.41ms | 2.52x
JLE Example 1: 0.50ms | 2.06x
---
Handlebars YAML: 4.74ms | 1.00x
Elastic YAML: 1.10ms | 4.32x
JLE Interpreted YAML: 0.68ms | 6.98x
JLE Async YAML: 1.10ms | 4.30x
JLE YAML: 1.42ms | 3.33x
---
Handlebars Partials: 1.72ms | 1.00x
Elastic Partials: 0.88ms | 1.95x
JLE Interpreted Partials: 0.28ms | 6.07x
JLE Async Partials: 0.22ms | 7.73x
JLE Partials: 0.51ms | 3.37x