@@ -7,20 +7,30 @@ the [Shopify/yjit](https://github.com/Shopify/yjit) repository.
77The benchmarks are found in the ` benchmarks ` directory. Individual Ruby files
88in ` benchmarks ` are microbenchmarks. Subdirectories under ` benchmarks ` are
99larger macrobenchmarks. Each benchmark relies on a harness found in
10- ` /lib /harness.rb` . The harness controls the number of times a benchmark is
11- run, and writes timing values into an output CSV file.
10+ [ ./harness /harness.rb] ( harness/harness.rb ) . The harness controls the number of times a benchmark is
11+ run, and writes timing values into an output file.
1212
13- The ` run_benchmarks.rb ` script traverses the ` benchmarks ` directory and
13+ The ` run_benchmarks.rb ` script (optional) traverses the ` benchmarks ` directory and
1414runs the benchmarks in there. It reads the
1515CSV file written by the benchmarking harness. The output is written to
1616an output CSV file at the end, so that results can be easily viewed or
1717graphed in any spreadsheet editor.
1818
19- yjit-bench expects to use chruby to run with YJIT.
19+ ## Running a single benchmark
2020
21- ## Installation
21+ This is the easiest way to run a single benchmark.
22+ It requires no setup at all and assumes nothing about the Ruby you are benchmarking.
23+ It's also convenient for profiling, debugging, etc, especially since all benchmarked code runs in that process.
24+ You can also use another harness or make your own by passing a different directory for ` -I ` .
2225
23- Install [ chruby] ( https://github.com/postmodern/chruby )
26+ ```
27+ ruby -Iharness benchmarks/some_benchmark.rb
28+ ```
29+
30+ ## Installation to use run_benchmarks.rb
31+
32+ ` run_benchmarks.rb ` expects to use chruby to run with YJIT, so you need to
33+ install [ chruby] ( https://github.com/postmodern/chruby ) .
2434
2535Clone this repository:
2636```
0 commit comments