io.warp10:warp10-ext-jmh
Installation
$ wf g -w /path/to/warp10 io.warp10 warp10-ext-jmh
/path/to/warp10/
is where Warp 10 is physically located.
Readme
JMH - Java Microbenchmark Harness
Introduction
This extension allow running benchmarks using JMH in WarpScript.
For instance, if you want to benchmark the COS
function, you would run the following script:
// If you do not need pre/post macros,
// you can just push a macro instead of a map.
{
'preinvocation' <% RAND %>
'macro' <% COS %>
'postinvocation' <% DROP %>
}
// All the keys are optional in the following map
{
'mem' '64m'
'forks' 1
'warmupTime' '1 s'
'measurementTime' '1 s'
'timeUnit' 'MICROSECONDS'
}
// Run the benchmark. Be careful, it is usually quite long.
JMH
Benchmarked Macro and Setup/TearDown Macros
The given macro is the only code being benchmarked. If you need to configure the stack, store or push element on it without impacting the benchmark, you need to do that in Setup/TearDown macros associated to the following keys:
- pretrial
- preiteration
- preinvocation
- postinvocation
- postiteration
- posttrial
If postinvocation
is not set, it defaults to <% CLEAR %>
.
Optional Configuration
Valid keys are:
forks
measurementBatchSize
measurementIterations
measurementTime
mode
operationsPerInvocation
profilers
shouldDoGC
syncIterations
threads
cannot be used as stack are mono-threadedtimeUnit
warmupBatchSize
warmupForks
warmupIterations
warmupMode
warmupTime
mem
set memory using both -Xms and -Xmx
Path | Size | Creation time |
---|---|---|
JMH | 2733 bytes | 2021-08-19 |
Configuration
//
Configuration template
//
Describe here the typical configuration needed to enable
and use the module.
//
This includes configuration primitives for the module itself
or for provided macros.
//
This configuration file is used by the wf tool for documenting
your module on the WarpFleetâ„¢ site.
//
warpscript.extension.jmh = io.warp10.script.ext.jmh.JMHWarpScriptExtension
Versions | Published |
---|---|
0.1.2-uberjar | 2021-08-20 |