#criterion #html #single #s3 #single-file #generate-html #onepage

app criterion-single-page-html

Collect criterion generated html files and provide them as a single html file, servable from s3 into your browser

2 releases

0.0.2 Sep 13, 2023
0.0.1 Sep 4, 2023

#335 in Profiling

MIT OR Apache-2.0 OR MPL-2.0

370KB
419 lines

criterion-single-page-html

Experimental shit code, yada yada

the pitch

Using concourse ci and referencing artifacts from github issues comments in an automated fashion, there is a need to quickly serve criterion bench runs against a baseline as part of a changeset, i.e. a pull request. Now, one could host and maintain a webserver with credentials to host the tree of files and folders that criterion generates, but that is cumbersome and infra shall be free of maintenence (for me) and be replacable. Here comes s3.

The super correct path would be to implement this as criterion render output, but this has multiple reasons to not do so, mostly due to alternative use cases across harness outputs.

what does it do?

It pulls in all files linked to <a href..> with relative paths starting from --root and integrates them into sections with unique ids, derived from the file content. There is special handling for linked .svg files.

The <link src=.. will be converted to inline data urls.

Boring, ey?

caveats

  • If you have a few 100 runs and svgs inlined, it becomes really slow. Remember, <section style="display=none"..s only hide the content yet still have to render it. Using inline svg files doesn't improve the situation much. Prepare for slow and unhappy browser tabs.
  • Currently svgs are not traversed besides the <title, which can lead to issues in case of local fonts.
  • Any links pointing to http:// or https:// urls will not be touched, only relative urls will be transformed.

Again, it's focused on dealing with criterion output primarily.

If you found this useful, perfect!

Dependencies

~13–20MB
~303K SLoC