Skip to content

Commit

Permalink
Rename benchmarks to put the language last, for better readability.
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 committed Feb 17, 2024
1 parent 1ddc835 commit 1636b45
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions part-09/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ The initial numbers I get on my laptop when executing the benchmark command

```
Benchmark Mode Cnt Score Error Units
FibonacciBenchmark.recursive_ezs_eval avgt 5 6028.256 ± 421.844 us/op
FibonacciBenchmark.recursive_eval_ezs avgt 5 6028.256 ± 421.844 us/op
FibonacciBenchmark.recursive_eval_js avgt 5 78.143 ± 3.453 us/op
FibonacciBenchmark.recursive_eval_sl avgt 5 55.662 ± 3.395 us/op
FibonacciBenchmark.recursive_java avgt 5 38.383 ± 1.046 us/op
FibonacciBenchmark.recursive_js_eval avgt 5 78.143 ± 3.453 us/op
FibonacciBenchmark.recursive_sl_eval avgt 5 55.662 ± 3.395 us/op
```

Clearly, our interpreter needs some work to catch up to the performance of the JavaScript and SimpleLanguage implementations.
Expand Down Expand Up @@ -82,7 +82,7 @@ With these changes, re-running the benchmark produces the following numbers:

```
Benchmark Mode Cnt Score Error Units
FibonacciBenchmark.recursive_ezs_eval avgt 5 102.190 ± 1.099 us/op
FibonacciBenchmark.recursive_eval_ezs avgt 5 102.190 ± 1.099 us/op
```

We have achieved almost a 60x speedup compared to the version from [part 8](../part-08).
Expand Down Expand Up @@ -110,7 +110,7 @@ you can add the appropriate JVM arguments in the benchmark configuration:
"-Dgraal.PrintGraph=Network"
})
@Benchmark
public int recursive_ezs_eval() {
public int recursive_eval_ezs() {
return this.truffleContext.eval("ezs", FIBONACCI_JS_PROGRAM).asInt();
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
* but also for the JavaScript implementation built-in into GraalVM,
* for Java, and also for SimpleLanguage.
*
* @see #recursive_ezs_eval
* @see #recursive_js_eval
* @see #recursive_eval_ezs
* @see #recursive_eval_js
* @see #recursive_eval_sl
* @see #recursive_java
* @see #recursive_sl_eval
*/
public class FibonacciBenchmark extends TruffleBenchmark {
private static final String FIBONACCI_JS_FUNCTION = "" +
Expand All @@ -25,17 +25,17 @@ public class FibonacciBenchmark extends TruffleBenchmark {
private static final String FIBONACCI_JS_PROGRAM = FIBONACCI_JS_FUNCTION + "fib(20);";

@Benchmark
public int recursive_ezs_eval() {
public int recursive_eval_ezs() {
return this.truffleContext.eval("ezs", FIBONACCI_JS_PROGRAM).asInt();
}

@Benchmark
public int recursive_js_eval() {
public int recursive_eval_js() {
return this.truffleContext.eval("js", FIBONACCI_JS_PROGRAM).asInt();
}

@Benchmark
public int recursive_sl_eval() {
public int recursive_eval_sl() {
return this.truffleContext.eval("sl", FIBONACCI_JS_FUNCTION +
"function main() { " +
" return fib(20); " +
Expand Down
6 changes: 3 additions & 3 deletions part-10/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ As it turns out, this simplified code is twice as fast on the Fibonacci benchmar

```
Benchmark Mode Cnt Score Error Units
FibonacciBenchmark.recursive_ezs_eval avgt 5 49.806 ± 0.835 us/op
FibonacciBenchmark.recursive_eval_ezs avgt 5 49.806 ± 0.835 us/op
FibonacciBenchmark.recursive_eval_js avgt 5 72.937 ± 2.110 us/op
FibonacciBenchmark.recursive_eval_sl avgt 5 52.396 ± 0.964 us/op
FibonacciBenchmark.recursive_java avgt 5 35.726 ± 0.497 us/op
FibonacciBenchmark.recursive_js_eval avgt 5 72.937 ± 2.110 us/op
FibonacciBenchmark.recursive_sl_eval avgt 5 52.396 ± 0.964 us/op
```
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ public class FibonacciBenchmark extends TruffleBenchmark {
private static final String FIBONACCI_JS_PROGRAM = FIBONACCI_JS_FUNCTION + "fib(20);";

@Benchmark
public int recursive_ezs_eval() {
public int recursive_eval_ezs() {
return this.truffleContext.eval("ezs", FIBONACCI_JS_PROGRAM).asInt();
}

@Benchmark
public int recursive_js_eval() {
public int recursive_eval_js() {
return this.truffleContext.eval("js", FIBONACCI_JS_PROGRAM).asInt();
}

@Benchmark
public int recursive_sl_eval() {
public int recursive_eval_sl() {
return this.truffleContext.eval("sl", FIBONACCI_JS_FUNCTION +
"function main() { " +
" return fib(20); " +
Expand Down

0 comments on commit 1636b45

Please sign in to comment.