Package org.teavm.perf
Class BenchmarkBackend
java.lang.Object
org.teavm.perf.BenchmarkBackend
- Direct Known Subclasses:
BrowserBackend,CBackend
Compiles benchmarks for a particular TeaVM backend and runs them.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidbuild(org.teavm.vm.TeaVMTarget target, String entryPoint, BenchmarkInfo benchmark, File directory, String fileName) abstract CompiledBenchmarkcompile(BenchmarkInfo benchmark, File directory) protected final voidcopyResource(String resource, File target) abstract StringHuman-readable description, used in reports.abstract StringgetName()Short identifier of the backend, also used in command line.abstract voidrun(CompiledBenchmark benchmark, String argument, Consumer<String> outputConsumer) Runs compiled benchmark once, i.e. performs a single JMH fork.voidstart()voidstop()booleantakeCpuProfile(String title) Returns CPU profile of measurement iterations of the last run, recorded with the given title.
-
Field Details
-
environment
-
-
Constructor Details
-
BenchmarkBackend
-
-
Method Details
-
getName
Short identifier of the backend, also used in command line. -
getDescription
Human-readable description, used in reports. Mapped tovmNamefield of JMH JSON output. -
compile
public abstract CompiledBenchmark compile(BenchmarkInfo benchmark, File directory) throws BenchmarkException - Throws:
BenchmarkException
-
start
- Throws:
BenchmarkException
-
stop
public void stop() -
run
public abstract void run(CompiledBenchmark benchmark, String argument, Consumer<String> outputConsumer) throws BenchmarkException Runs compiled benchmark once, i.e. performs a single JMH fork.- Parameters:
outputConsumer- receives every line written by benchmark to stdout.- Throws:
BenchmarkException
-
supportsCpuProfiling
public boolean supportsCpuProfiling() -
takeCpuProfile
Returns CPU profile of measurement iterations of the last run, recorded with the given title.- Returns:
- profile in Chrome DevTools format (
.cpuprofile). - Throws:
BenchmarkException
-
build
protected final void build(org.teavm.vm.TeaVMTarget target, String entryPoint, BenchmarkInfo benchmark, File directory, String fileName) throws BenchmarkException - Throws:
BenchmarkException
-
copyResource
- Throws:
BenchmarkException
-