Skip to content

Instantly share code, notes, and snippets.

@nitsanw
Created January 21, 2013 21:40
Show Gist options
  • Save nitsanw/4589721 to your computer and use it in GitHub Desktop.
Save nitsanw/4589721 to your computer and use it in GitHub Desktop.
UTF8 benchmark output with allocation
benchmark-utf8-encoding:
[java] 0% Scenario{vm=java, trial=0, benchmark=CustomEncoder, direct=true, stringsFile=utf8.txt} 99842.67 ns; σ=741.65 ns @ 3 trials, allocated 0 instances for a total of 0B
[java] 17% Scenario{vm=java, trial=0, benchmark=StringGetBytes, direct=true, stringsFile=utf8.txt} 204718.91 ns; σ=11685.98 ns @ 10 trials, allocated 2672 instances for a total of 166024B
[java] 33% Scenario{vm=java, trial=0, benchmark=CharsetEncoder, direct=true, stringsFile=utf8.txt} 267964.76 ns; σ=2541.32 ns @ 3 trials, allocated 0 instances for a total of 0B
[java] 50% Scenario{vm=java, trial=0, benchmark=CustomEncoder, direct=false, stringsFile=utf8.txt} 102537.55 ns; σ=5065.85 ns @ 10 trials, allocated 0 instances for a total of 0B
[java] 67% Scenario{vm=java, trial=0, benchmark=StringGetBytes, direct=false, stringsFile=utf8.txt} 202675.42 ns; σ=6581.97 ns @ 10 trials, allocated 2672 instances for a total of 166024B
[java] 83% Scenario{vm=java, trial=0, benchmark=CharsetEncoder, direct=false, stringsFile=utf8.txt} 197434.59 ns; σ=11170.45 ns @ 10 trials, allocated 0 instances for a total of 0B
[java] benchmark direct instances B us linear runtime
[java] CustomEncoder true 0 0 99.8 ===========
[java] CustomEncoder false 0 0 102.5 ===========
[java] StringGetBytes true 2672 166024 204.7 ======================
[java] StringGetBytes false 2672 166024 202.7 ======================
[java] CharsetEncoder true 0 0 268.0 ==============================
[java] CharsetEncoder false 0 0 197.4 ======================
[java] vm: java
[java] trial: 0
[java] stringsFile: utf8.txt
BUILD SUCCESSFUL
Total time: 2 minutes 11 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment