silk.bench.html.

Draws a benchmark report as one static HTML page with charts.

When to use#

Call Html.page on a silk.bench.record.Report to make a page you can open, attach to a pull request, or publish. silk.bench.bench calls it for the outputs a suite declares with Format.Html, and for --html.

Details#

The page is one file: its style is inline, its charts are inline SVG, and it loads nothing and runs no script, so it opens the same from a disk, an archive, or a web server. It follows the reader's light or dark color scheme.

Each benchmark has the table of silk.bench.render and one chart on a shared time axis that starts at zero. A row of the chart is an implementation: a bar to its median, a whisker over the 95% interval of the median, and one dot for each run, so a reader sees the spread and any outlier. A bar is green or red only when the verdict is faster or slower; the table says the same in words.

Import as Html with import silk.bench.html { Html }.

Public declarations: 1.

Html#

silk
pub struct Html

The owner type of the HTML renderer. It has no fields and is never constructed.

Implementation Html#

silk
impl Html

Associated function style#

silk
pub fn style() -> string<'static>

Returns the style sheet of the pages this module writes, for another page that should look the same.

Associated function escaped#

silk
pub effect fn escaped(text: &mut String, value: string) -> ()
    ! OutOfMemoryError
    ? &mut Allocator

Appends value to text with the characters &, <, > and " written as HTML entities.

Errors#

OutOfMemoryError if the Allocator cannot grow text.

Associated function page#

silk
pub effect fn page(report: &Report) -> String
    ! OutOfMemoryError
    ? &mut Allocator

Returns report as one complete HTML document.

Errors#

OutOfMemoryError if the Allocator cannot supply the text.

Category: Benchmarks.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page