You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: benchmark/README.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
These benchmarks are written in typescript and transpiled to lua by using tstl.
4
4
5
-
### Currently only memory benchmarks are supported
5
+
### Memory benchmarks
6
6
7
7
To add a new benchmark add a new file to `memory_benchmarks`
8
8
and **default** export a function with the following type: `() => void`.
9
9
To prevent the benchmark from reporting "useful" results of your benchmark function as garbage, simply return the result.
10
-
The memory used by the returned result wont count towards the total garbage amount.
10
+
The memory used by the returned result won't count towards the total garbage amount.
11
11
12
12
For example (memory_benchmarks/my_benchmark.ts):
13
13
@@ -25,19 +25,23 @@ export default function myBenchmark() {
25
25
**Goal**
26
26
27
27
The goal of memory benchmarks is to track how much (memory) `"garbage"` is created by tstl.
28
-
For that reason garabage collection is disabled in the benchmarks.
28
+
For that reason garbage collection is disabled in the benchmarks.
29
29
30
30
You can force the creation of `"garbage"` by creating a lot of anonymous functions or temporary tables (see [lua-users.org](http://lua-users.org/wiki/OptimisingGarbageCollection) for more information).
31
31
32
32
To avoid crashes in the CI your benchmark should not use more than 500MB of memory.
33
33
34
-
**Running locally**
34
+
### Runtime benchmarks
35
35
36
-
1. Create a benchmark baseline called "benchmark_baseline.json":
36
+
To add a new runtime benchmark (execution time), add a new file to `runtime_benchmarks` and **default** export a function with the following type: `() => void`.
37
+
38
+
### Running locally
39
+
40
+
1. Create a benchmark baseline called "benchmark_baseline.json":
0 commit comments