Skip to content

Commit

Permalink
Parameterize benchmarks to check interpreted and compiled class perfo…
Browse files Browse the repository at this point in the history
…rmance.
  • Loading branch information
aardvark179 authored and gbrail committed Dec 30, 2024
1 parent f87e7f3 commit 252293c
Show file tree
Hide file tree
Showing 6 changed files with 253 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ public class BuiltinBenchmark {
@State(Scope.Thread)
public static class AbstractClassState {

@Param({"false", "true"})
public boolean interpreted;

public void init()
throws IllegalAccessException, InvocationTargetException, InstantiationException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);

scope = cx.initStandardObjects();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ public static class MathState {
Function bitwiseRsh;
Function bitwiseSignedRsh;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
public void setup() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);
scope = cx.initStandardObjects();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@ public static class FieldTestState {
Scriptable strings;
Scriptable ints;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
@SuppressWarnings("unused")
public void create() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);

scope = new Global(cx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ public static class PropertyState {

Object object;

@Param({"false", "true"})
public boolean interpreted;

@Setup(Level.Trial)
public void setup() throws IOException {
cx = Context.enter();
cx.setInterpretedMode(interpreted);
cx.setLanguageVersion(Context.VERSION_ES6);
scope = cx.initStandardObjects();

Expand Down
Loading

0 comments on commit 252293c

Please sign in to comment.