k0kubun / hamlit

High Performance Haml Implementation
https://rubygems.org/gems/hamlit
Other
981 stars 59 forks source link

Implement DynamicMerger #146

Closed k0kubun closed 5 years ago

k0kubun commented 5 years ago

string_template's benchmark w/ Hamlit

before

Calculating -------------------------------------
              string    39.969k i/s -    100.000k times in 2.501936s (25.02μs/i)
              hamlit    34.498k i/s -    100.000k times in 2.898699s (28.99μs/i)

Comparison:
              string:     39969.0 i/s
              hamlit:     34498.2 i/s - 1.16x  slower

after

Calculating -------------------------------------
              string    39.740k i/s -    100.000k times in 2.516339s (25.16μs/i)
              hamlit    39.719k i/s -    100.000k times in 2.517673s (25.18μs/i)

Comparison:
              string:     39740.3 i/s
              hamlit:     39719.2 i/s - 1.00x  slower
k0kubun commented 5 years ago

benchmark/etc/string_interpolation.haml

before

Calculating -------------------------------------
         haml v5.1.2    32.401k i/100ms
         faml v0.8.1    58.482k i/100ms
       hamlit v2.9.5    87.706k i/100ms
-------------------------------------------------
         haml v5.1.2    375.259k i/s (0.003ms) -      1.879M
         faml v0.8.1    696.889k i/s (0.001ms) -      3.509M
       hamlit v2.9.5      1.195M i/s (0.001ms) -      6.052M

Comparison:
       hamlit v2.9.5:  1194843.2 i/s (0.001ms)
         faml v0.8.1:   696889.1 i/s (0.001ms) - 1.71x slower
         haml v5.1.2:   375259.1 i/s (0.003ms) - 3.18x slower

after

Calculating -------------------------------------
         haml v5.1.2    33.535k i/100ms
         faml v0.8.1    60.561k i/100ms
      hamlit v2.10.0    93.471k i/100ms
-------------------------------------------------
         haml v5.1.2    378.851k i/s (0.003ms) -      1.878M
         faml v0.8.1    710.606k i/s (0.001ms) -      3.513M
      hamlit v2.10.0      1.307M i/s (0.001ms) -      6.543M

Comparison:
      hamlit v2.10.0:  1307490.2 i/s (0.001ms)
         faml v0.8.1:   710605.9 i/s (0.001ms) - 1.84x slower
         haml v5.1.2:   378850.8 i/s (0.003ms) - 3.45x slower