Package org.teavm.perf
Class BrowserBackend
java.lang.Object
org.teavm.perf.BenchmarkBackend
org.teavm.perf.BrowserBackend
- Direct Known Subclasses:
JsBackend,WasmGCBackend
Runs benchmarks in a browser using
BrowserRunner. Every fork runs in a fresh iframe.-
Field Summary
Fields inherited from class org.teavm.perf.BenchmarkBackend
environment -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBrowserBackend(BenchmarkEnvironment environment, String browser) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Stringvoidrun(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.Methods inherited from class org.teavm.perf.BenchmarkBackend
build, compile, copyResource, getDescription, getName
-
Constructor Details
-
BrowserBackend
-
-
Method Details
-
getRunnerType
-
start
- Overrides:
startin classBenchmarkBackend- Throws:
BenchmarkException
-
stop
public void stop()- Overrides:
stopin classBenchmarkBackend
-
supportsCpuProfiling
public boolean supportsCpuProfiling()- Overrides:
supportsCpuProfilingin classBenchmarkBackend
-
takeCpuProfile
Description copied from class:BenchmarkBackendReturns CPU profile of measurement iterations of the last run, recorded with the given title.- Overrides:
takeCpuProfilein classBenchmarkBackend- Returns:
- profile in Chrome DevTools format (
.cpuprofile). - Throws:
BenchmarkException
-
run
public void run(CompiledBenchmark benchmark, String argument, Consumer<String> outputConsumer) throws BenchmarkException Description copied from class:BenchmarkBackendRuns compiled benchmark once, i.e. performs a single JMH fork.- Specified by:
runin classBenchmarkBackend- Parameters:
outputConsumer- receives every line written by benchmark to stdout.- Throws:
BenchmarkException
-