Repository navigation
benchmark against other image libraries - #61
Merged
Merged
Conversation
bench/ compares ImageScript to ImageScript 1, Jimp, image-js, Photon, sharp and @napi-rs/canvas: decoding, encoding, image operations, text and SVG rendering, animated GIFs, encoded file sizes and install sizes. Every library runs in its own process (run.js), install sizes are measured with npm in an empty project (installs.js), report.js draws the charts and writes bench/README.md. The release workflow runs it for every regular release against the released version and commits the results; bench.yml can also be run by hand. Inputs are from Wikimedia Commons (CC BY 2.0, CC0, public domain, see bench/inputs/SOURCES.md). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YJgRK5qpwJEbHPuFv6kgAQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
bench/, a benchmark comparing ImageScript with ImageScript 1, Jimp, image-js, Photon, sharp and @napi-rs/canvas. It measures:The results, with charts, go to
bench/README.md, and the main README links to them.run.jsruns every library in its own process (bench.js). @napi-rs/canvas frees native memory only in finalizers, so for that library the run callsgc()and yields to the event loop between iterations. Without this, its memory grew by several GB. Skia draws lazily, so a single-pixelgetImageDataforces it to actually render; otherwise its numbers are fake.installs.jsrunsnpm installfor each library in an empty project and measuresnode_modulesand the number of packages actually installed.report.jsdraws the charts and writes the README.bench/inputs/SOURCES.md.bench/package.json.IMAGESCRIPT=localbenchmarksdist/instead of the npm package.CI:
release.ymlhas a newbenchjob for regular releases (dist-taglatest). It callsbench.yml, which installs the version that was just published, runs everything and commits the results to master.bench.ymlcan also be run by hand with a version.Notes:
bench.ymlonce after merging replaces them with runner numbers.