Skip to content

Commit 7b02f04

Browse files
authored
Update benchmarks to recent versions of templating engines. (#199)
* Chore: update benchmarks to recent versions of templating engines. * Fix: restore chart title.
1 parent 5e8ad0f commit 7b02f04

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,30 @@ given no performance difference between them.
2020
### What is Hamlit?
2121
Hamlit is another implementation of [Haml](https://github.com/haml/haml).
2222
With some [Hamlit's characteristics](REFERENCE.md#hamlits-characteristics) for performance,
23-
Hamlit is **1.94x times faster** than the original Haml 5 in [this benchmark](benchmark/run-benchmarks.rb),
23+
Hamlit was 1.94x times faster than the original Haml 5 in [this benchmark](benchmark/run-benchmarks.rb),
2424
which is an HTML-escaped version of [slim-template/slim's one](https://github.com/slim-template/slim/blob/4.1.0/benchmarks/run-benchmarks.rb) for fairness.
25+
Recent benchmarks no longer show this difference in performance.
2526

26-
<img src="https://raw.githubusercontent.com/k0kubun/hamlit/afcc2b36c4861c2f764baa09afd9530ca25eeafa/benchmark/graph/graph.png" width="600x" alt="Hamlit Benchmark" />
27+
<img src="benchmark/graph.svg" alt="Hamlit Benchmark" />
2728

2829
```
29-
hamlit v2.13.0: 247404.4 i/s
30-
erubi v1.9.0: 244356.4 i/s - 1.01x slower
31-
slim v4.1.0: 238254.3 i/s - 1.04x slower
32-
faml v0.8.1: 197293.2 i/s - 1.25x slower
33-
haml v5.2.0: 127834.4 i/s - 1.94x slower
30+
ruby 4.0.0 (2025-12-25 revision 553f1675f3) +YJIT +PRISM [x86_64-linux]
31+
Warming up --------------------------------------
32+
erubi v1.13.1 68.899k i/100ms
33+
slim v5.2.1 61.171k i/100ms
34+
haml v7.1.0 71.782k i/100ms
35+
hamlit v4.0.0 73.627k i/100ms
36+
Calculating -------------------------------------
37+
erubi v1.13.1 707.031k (± 0.9%) i/s (1.41 μs/i) - 3.583M in 5.067776s
38+
slim v5.2.1 615.437k (± 0.6%) i/s (1.62 μs/i) - 3.120M in 5.069276s
39+
haml v7.1.0 730.772k (± 1.0%) i/s (1.37 μs/i) - 3.661M in 5.010166s
40+
hamlit v4.0.0 741.546k (± 0.6%) i/s (1.35 μs/i) - 3.755M in 5.063918s
41+
42+
Comparison:
43+
hamlit v4.0.0: 741546.2 i/s
44+
haml v7.1.0: 730771.6 i/s - same-ish: difference falls within error
45+
erubi v1.13.1: 707030.8 i/s - 1.05x slower
46+
slim v5.2.1: 615436.7 i/s - 1.20x slower
3447
```
3548

3649
### Why is Hamlit fast?

benchmark/graph.svg

Lines changed: 56 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)