Repository navigation
feat: report each encoder's peak memory - #60
Merged
Merged
Conversation
Every encode already runs under /usr/bin/time, which also reports the peak resident memory: GNU time through a format with %M (kilobytes), BSD time on macOS with -l (bytes). The comparison table gains a memory column, both CSVs an encode_peak_rss_bytes column before error, and the HTML report's stats panel the same figure. It is the peak of the single encode at the target, or the largest of the --time-runs encodes, and n/a where /usr/bin/time is missing.
Codec comparison ✅ no size or quality regression📥 Download the codec report (unzip and open Size check |
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.
What
From the ROADMAP's "Encode memory" idea (it comes from image-codec-bench): memory is part of an encoder's cost, and matters where many images are encoded in parallel.
exec.js:/usr/bin/timeruns with-f "real %e\nuser %U\nsys %S\nmaxrss %M"when it is GNU time (detected by--version),-l -pon macOS and the BSDs, and-pelsewhere.parseTimeOutputreturnspeakBytesfrom GNU'smaxrss(KB) or BSD's "maximum resident set size" (bytes), null when absent.--time-runs, the largest of the runs.memorycolumn in the table (MB),encode_peak_rss_bytesin both CSVs, andmemoryin the HTML stats panel. CSV change: the new column sits beforeerror, which stays last; readers by column position need updating (readers by header name, including the regression gate, are unaffected).memory; the ROADMAP item is removed.Verification
node --test: 99 pass, including GNU and BSD parsing, the table, CSV and HTML.ghcr.io/nucliweb/image-tools:0.5.0with this branch mounted (GNU time); the new assertion checks every CSV row carries a positive peak memory.cid22-friends.png: macOS gives 4.5–42.3 MB, the image 5.6–48.9 MB across the six codecs; the HTML report shows the figure in headless Chrome.