-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Uint8ClampedArray
when returning image data in src/core/jbig2.js
and src/core/jpg.js
#8783
Use Uint8ClampedArray
when returning image data in src/core/jbig2.js
and src/core/jpg.js
#8783
Conversation
…ble with both `Uint8Array` and `Uint8ClampedArray`
…js` and `src/core/jpg.js`
Since we're now using `Uint8ClampedArray`, rather than `Uint8Array`, doing manual clamping shouldn't be necessary given that that is now handled natively. This shouldn't have any measurable performance impact, but just to sanity check that I've done some quick benchmarking with the following manifest file: ```json [ { "id": "S2-eq", "file": "pdfs/S2.pdf", "md5": "d0b6137846df6e0fe058f234a87fb588", "rounds": 100, "type": "eq" } ] ``` which gave the following results against the current `master` (repeated benchmark runs didn't result in any meaningful differences): ``` -- Grouped By browser, stat -- browser | stat | Count | Baseline(ms) | Current(ms) | +/- | % | Result(P<.05) ------- | ------------ | ----- | ------------ | ----------- | --- | ----- | ------------- firefox | Overall | 100 | 592 | 592 | 1 | 0.12 | firefox | Page Request | 100 | 3 | 3 | 0 | -9.88 | firefox | Rendering | 100 | 588 | 589 | 1 | 0.18 | ```
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/ddc6399ecd03d28/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.215.176.217:8877/1a58469edbb22ae/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/ddc6399ecd03d28/output.txt Total script time: 16.39 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.215.176.217:8877/1a58469edbb22ae/output.txt Total script time: 29.64 mins
|
/botio-linux preview |
From: Bot.io (Linux m4)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/602f54cfa6813b8/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/602f54cfa6813b8/output.txt Total script time: 2.34 mins Published |
Looks good. Thank you! |
…t8ClampedArray Use `Uint8ClampedArray` when returning image data in `src/core/jbig2.js` and `src/core/jpg.js`
The following was done in a separate commit, to make it easy to revert just in case it's not a desired change: Remove manual clamping code in
src/core/jpx.js
Since we're now using
Uint8ClampedArray
, rather thanUint8Array
, doing manual clamping shouldn't be necessary given that that is now handled natively.This shouldn't have any measurable performance impact, but just to sanity check that I've done some quick benchmarking with the following manifest file:
which gave the following results against the current
master
(repeated benchmark runs didn't result in any meaningful differences):