Skip to content

Latest commit

 

History

History
66 lines (47 loc) · 1.54 KB

README.MD

File metadata and controls

66 lines (47 loc) · 1.54 KB

Benchmark

Benchmarks are run in the JVM and compare time execution of:

The test is to parse and render the same document.

  1. Simple [link]:
<b>User:</b> {{ firstName }} {{ lastName }}
  1. Complex [link]:
<b>Hello {{user.firstName}} {{user.lastName}}</b>
You have just won {{value}} dollars!</br>
{{#isTaxed}}
    Today's win is taxed at {{ rate }}%
{{/isTaxed}}
  1. Multiple (x1, x10, x50) [link]:
<h1>Last's winners</h1>
Total number of winners : {{ winnersCount }}
{{#winners}}
    <li>
        {{user.firstName}} {{user.lastName}} <br/>
        Amount : {{value}}{{#isTaxed}} at {{ rate }}%{{/isTaxed}}
    </li>
{{/winners}}

run

  • Smoke: ./gradlew :benchmark:jvmMainSmokeBenchmark
  • Full: ./gradlew :benchmark:jvmMainBenchmark

Results

Overall, performance is good:

  • Parsing documents in Ktm is faster than Mustache.java.
  • Rendering documents is as fast as Mustache.java.
On my mac mini:
Host: Mac mini 2023
CPU: M2
OS: macOS Sonoma Version 14.2.1
java version "21.0.1" 2023-10-17-LTS

View benchmark

raw json file