Files
modeling-app/docs/kcl
Adam Chalmers 594e888c12 Benchmark rust in CI with iai, not criterion (#1937)
* Rename cargo-criterion to cargo-bench

* Use iai not criterion in CI

We want to benchmark the KCL parser and tokenizer to make sure we don't
accidentally slow them down. Generally Rust projects use Criterion to
benchmark code. Criterion runs your functions a few thousand times to
get reliable wall-clock measurements.

This is good for locally benchmarking but bad for benchmarking in CI.
Why? Because in CI, you're running a container on some shared VM, so
wall-clock time might have a lot of interference from noisy neighbours.
Also, your benchmarks take a long time to run and eat up paid CI minutes.

A better approach for benchmarking in CI is to just count the number of
CPU instructions executed. This correlates with wall-clock time, but it
only needs to run the function once, so it takes much less time. It also
isn't changed by any noisy neighbours running on the same VM or hardware.

This PR adds a new benchmark suite which counts instructions using `iai`,
from the creator of criterion. He says iai and criterion complement each
other nicely. We can run criterion locally and run iai in CI.

* Update image in markdown docs
2024-04-04 09:50:34 -05:00
..
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-03-27 10:21:46 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-03-13 22:43:42 +00:00
2024-03-27 02:07:16 +00:00
2024-03-13 14:22:22 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-03-13 14:22:22 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00
2024-04-02 18:40:39 -07:00