Skip to content

Commit

Permalink
docs: fix dangling references to run-bench
Browse files Browse the repository at this point in the history
4fab6c added the current bench runner script as `benches/run`, and
removed the old `run-bench` script. It was later renamed to `bench/run`
when `benches` was renamed to `bench` in b217bf. This patch fixes a few
references to the old benchmark runner in the hacking guide as well
as a few references to the old directory structure. The cargo plugin
syntax in the example is also updated.
  • Loading branch information
Ethan Pailes authored and BurntSushi committed Dec 30, 2017
1 parent 3a834e3 commit ba3cf03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ times slightly, try using `cargo test --test default`, which will only use the

The benchmarking in this crate is made up of many micro-benchmarks. Currently,
there are two primary sets of benchmarks: the benchmarks that were adopted
at this library's inception (in `benches/src/misc.rs`) and a newer set of
at this library's inception (in `bench/src/misc.rs`) and a newer set of
benchmarks meant to test various optimizations. Specifically, the latter set
contain some analysis and are in `benches/src/sherlock.rs`. Also, the latter
contain some analysis and are in `bench/src/sherlock.rs`. Also, the latter
set are all executed on the same lengthy input whereas the former benchmarks
are executed on strings of varying length.

Expand All @@ -292,36 +292,36 @@ library benchmarks (especially RE2).
If you're hacking on one of the matching engines and just want to see
benchmarks, then all you need to run is:

$ ./run-bench rust
$ ./bench/run rust

If you want to compare your results with older benchmarks, then try:

$ ./run-bench rust | tee old
$ ./bench/run rust | tee old
$ ... make it faster
$ ./run-bench rust | tee new
$ cargo-benchcmp old new --improvements
$ ./bench/run rust | tee new
$ cargo benchcmp old new --improvements

The `cargo-benchcmp` utility is available here:
https://github.com/BurntSushi/cargo-benchcmp

The `run-bench` utility can run benchmarks for PCRE and Oniguruma too. See
`./run-bench --help`.
The `./bench/run` utility can run benchmarks for PCRE and Oniguruma too. See
`./bench/bench --help`.

## Dev Docs

When digging your teeth into the codebase for the first time, the
crate documentation can be a great resource. By default `rustdoc`
will strip out all documentation of private crate members in an
effort to help consumers of the crate focus on the *interface*
without having to concern themselves with the *implimentation*.
without having to concern themselves with the *implementation*.
Normally this is a great thing, but if you want to start hacking
on regex internals it is not what you want. Many of the private members
of this crate are well documented with rustdoc style comments, and
it would be a shame to miss out on the opportunity that presents.
You can generate the private docs with:

```
> rustdoc --crate-name docs src/lib.rs -o target/doc -L target/debug/deps --no-defaults --passes collapse-docs --passes unindent-comments
$ rustdoc --crate-name docs src/lib.rs -o target/doc -L target/debug/deps --no-defaults --passes collapse-docs --passes unindent-comments
```

Then just point your browser at `target/doc/regex/index.html`.
Expand Down
2 changes: 1 addition & 1 deletion bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ bench = false
# Doing anything else will probably result in weird "duplicate definition"
# compiler errors.
#
# Tip: use the run script in this directory to run benchmarks.
# Tip: use the `bench/run` script (in this directory) to run benchmarks.
[features]
re-pcre1 = ["libpcre-sys"]
re-pcre2 = []
Expand Down

0 comments on commit ba3cf03

Please sign in to comment.