Skip to content

Commit

Permalink
Merge pull request #94 from StarpTech/#93_improve_docs_build_time
Browse files Browse the repository at this point in the history
#93 improve docs build time
  • Loading branch information
katelyn martin authored Nov 17, 2021
2 parents 2228240 + c1e97b9 commit b4421a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ To install Viceroy as a standalone tool, you'll need to first
Then run `cargo install viceroy`, which will download and build the latest
Viceroy release.

## Usage as a library

Viceroy can be used as a [Rust library](https://docs.rs/viceroy-lib/). This is useful if you want to run integration tests in the same codebase. We provide a helper method [`handle_request`](https://docs.rs/viceroy-lib/0.2.6/viceroy_lib/struct.ExecuteCtx.html#method.handle_request). Before you build or test your code, we recommend to set the release flag e.g. `cargo test --release` otherwise, the execution will be very slow. This has to do with the Cranelift compiler, which is extremely slow when compiled in debug mode. Besides that, if you use Github Actions don't forget to setup a build [cache](https://github.com/actions/cache/blob/main/examples.md#rust---cargo) for Rust. This will speed up your build times a lot.

## Usage as a standalone tool

**NOTE**: the Viceroy standalone CLI has a somewhat different interface from that
Expand Down
4 changes: 4 additions & 0 deletions lib/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ impl ExecuteCtx {
/// instantiated module's WASI entry point, running to completion. If execution
/// results in an error, a response is still produced, but with a 500 status code.
///
/// Build time: Before you build or test your code, we recommend to set the release flag
/// e.g. `cargo test --release` otherwise the execution will be very slow. This has to do
/// with the Cranelift compiler, which is extremely slow when compiled in debug mode.
///
/// # Example
///
/// ```no_run
Expand Down

0 comments on commit b4421a7

Please sign in to comment.