-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update document for benchmarking instructions
- Loading branch information
Showing
1 changed file
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,52 @@ | ||
# To run Coalton Benchmarks: | ||
# To run Coalton benchmarks: | ||
|
||
`(ql:quickload :coalton/benchmarks)` or `(asdf:load-system :coalton/benchmarks)` | ||
- `(ql:quickload :coalton/benchmarks)` or `(asdf:load-system :coalton/benchmarks)` | ||
|
||
`(in-package #:coalton-benchmarks)` | ||
- `(in-package #:coalton-benchmarks)` | ||
|
||
`(run-benchmarks)` | ||
- `(run-benchmarks)` runs all the benchmarks | ||
|
||
- `(run-benchmark :BENCHMARK-PACKAGE)` runs the named benchmark package. | ||
|
||
# To add a new benchmark | ||
|
||
## Add `define-coalton-benchmark` form in `package.lisp` | ||
|
||
``` | ||
(define-coalton-benchmark mybenchmark | ||
(<extra-package-clause> ...) | ||
<native-package-clause> | ||
...) | ||
``` | ||
|
||
This expands into two package definitions as follows. | ||
|
||
``` | ||
(define-benchmark-package :benchmark-mybenchmark | ||
<extra-package-clause> ...) | ||
(defpackage :benchmark-mybenchmark/native | ||
<native-package-clause> ...) | ||
``` | ||
|
||
The idea is to put coalton code into the `/native` package, and | ||
benchmarking code that calls the coalton code (`define-benchmark` | ||
form etc.) in the package without `/native`. | ||
|
||
## Add benchmark source files | ||
|
||
``` | ||
(cl:in-package :benchmark-mybenchmark) | ||
(define-benchmark ...) | ||
(cl:in-package :benchmark-mybenchmark/native | ||
(coalton-toplevel | ||
... | ||
) | ||
``` | ||
|
||
## Add the benchmark source files in `coalton.asd` |