Skip to content

Fix Handlebars benchmarks#775

Merged
sebastienros merged 3 commits intomainfrom
sebros/hbbench
Apr 5, 2025
Merged

Fix Handlebars benchmarks#775
sebastienros merged 3 commits intomainfrom
sebros/hbbench

Conversation

@sebastienros
Copy link
Copy Markdown
Owner

Was wondering how this benchmark would not allocate as much as the others. It's actually not doing the same thing. The {{#truncate}} is not a thing unless implemented specifically.

Also changing the size of the list so the end result isn't too big. Will update the benchmark results in the other PR that has the charts.

@sebastienros
Copy link
Copy Markdown
Owner Author

Sneak peek

| Method            | Mean      | Error     | StdDev   | Ratio | RatioSD | Gen0     | Gen1    | Allocated  | Alloc Ratio |
|------------------ |----------:|----------:|---------:|------:|--------:|---------:|--------:|-----------:|------------:|
| Fluid_Render      |  49.60 us |  4.145 us | 0.227 us |  1.00 |    0.01 |   1.2207 |       - |   20.09 KB |        1.00 |
| Scriban_Render    | 163.75 us |  6.036 us | 0.331 us |  3.30 |    0.01 |   8.5449 |  1.2207 |  140.26 KB |        6.98 |
| DotLiquid_Render  | 411.75 us | 75.632 us | 4.146 us |  8.30 |    0.08 |  41.5039 |  8.3008 |  685.49 KB |       34.11 |
| LiquidNet_Render  | 525.88 us | 92.355 us | 5.062 us | 10.60 |    0.10 | 160.1563 | 39.0625 | 2638.38 KB |      131.30 |
| Handlebars_Render | 145.82 us | 31.189 us | 1.710 us |  2.94 |    0.03 |   9.5215 |  0.9766 |   155.7 KB |        7.75 |

@sebastienros
Copy link
Copy Markdown
Owner Author

As a matter of fact Fluid was not valid either ;)

Here are the new results. Also removing Liquid.NET since it's much slower and not in active development for a long time.

| Method            | Mean      | Error    | StdDev   | Ratio | RatioSD | Gen0    | Gen1   | Allocated | Alloc Ratio |
|------------------ |----------:|---------:|---------:|------:|--------:|--------:|-------:|----------:|------------:|
| Fluid_Render      |  65.53 us | 14.13 us | 0.775 us |  1.00 |    0.01 |  2.9297 |      - |  47.91 KB |        1.00 |
| Scriban_Render    | 164.26 us | 54.60 us | 2.993 us |  2.51 |    0.05 |  8.5449 | 1.2207 | 140.26 KB |        2.93 |
| DotLiquid_Render  | 430.85 us | 44.02 us | 2.413 us |  6.58 |    0.07 | 41.5039 | 8.3008 | 685.49 KB |       14.31 |
| Handlebars_Render | 141.53 us | 12.04 us | 0.660 us |  2.16 |    0.02 |  9.5215 | 0.9766 |  155.7 KB |        3.25 |

@sebastienros sebastienros merged commit 41d0287 into main Apr 5, 2025
1 check passed
@sebastienros sebastienros deleted the sebros/hbbench branch April 5, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant