-
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
Graphic optimizations 1 #4708
Graphic optimizations 1 #4708
Conversation
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.22.172.223:8877/52cacf1685a64fa/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://107.21.233.14:8877/fbbf53ccc33c842/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/52cacf1685a64fa/output.txt Total script time: 22.17 mins
Image differences available at: http://107.22.172.223:8877/52cacf1685a64fa/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux)FailedFull output at http://107.21.233.14:8877/fbbf53ccc33c842/output.txt Total script time: 26.70 mins
Image differences available at: http://107.21.233.14:8877/fbbf53ccc33c842/reftest-analyzer.html#web=eq.log |
Something has gone with with the CalGrayCS refactoring I think, given that all CalGray tests fail. |
Thanks. Good thing all the CalGray test failed. Made it easier to fix them all :) |
As usual when working on/optimizing color conversions, there might be rounding errors here and there, but nothing noticeable. |
y = data[i + 2] * 0.00392156862745098; | ||
k = data[i + 3] * 0.00392156862745098; | ||
var length = data.length; | ||
var min = -255 *255 * 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: missing space after the first multiplication sign.
Thanks! |
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/5cc9c869a85b530/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.21.233.14:8877/3ce17d6cbd0b940/output.txt |
From: Bot.io (Windows)FailedFull output at http://107.22.172.223:8877/5cc9c869a85b530/output.txt Total script time: 1.19 mins
Image differences available at: http://107.22.172.223:8877/5cc9c869a85b530/reftest-analyzer.html#web=eq.log |
/botio-windows test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @yurydelendik received. Current queue size: 0 Live output at: http://107.22.172.223:8877/0e123f29fdd66a4/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/3ce17d6cbd0b940/output.txt Total script time: 25.82 mins
|
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/0e123f29fdd66a4/output.txt Total script time: 22.05 mins
|
Is the commit history OK or should I squash some/all ? |
I think we are fine, but we might be missing the polyfill for Uint8Array |
Which polyfill ? About the history, I just noticed 2 fixups squashed in the wrong commit. I'll tidy this up on Friday, or squash it all to one commit tomorrow, as you prefer. |
r = (buffer[i] - matteR) * k + matteR; | ||
g = (buffer[i + 1] - matteG) * k + matteG; | ||
b = (buffer[i + 2] - matteB) * k + matteB; | ||
buffer[i] = r <= 0 ? 0 : r >= 255 ? 255 : r | 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking moving cast to int32 (r | 0
) above and giving r
the int32 type might speedup the comparison operations (r <= 0
and r >= 255
). I run tests at http://jsperf.com/precast to confirm this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I contributed two test runs on IE11 (listed as Other by JSPerf) besides being significantly slower than real browsers, in IE the "after" code was faster.
I just ran Yury's test in Opera 22 and IE 11 on my 2-3yo desktop computer. Casting before hand was 23% and 12% faster respectively. Thanks for the test. The results do make sense. |
…lockData Linearize and scale the mcu blocks into the destination buffer in a single pass
/botio test |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/8038daccdb1bacf/output.txt |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/f6ceb1d025e62b9/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/8038daccdb1bacf/output.txt Total script time: 22.10 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/f6ceb1d025e62b9/output.txt Total script time: 25.65 mins
|
Thank you for the patch |
The main optimizations here are in the CalGrayCS conversion and JPG decoder's getLinearizedBlockData and convertCmykToRgb which got 2.16x and 1.5x faster respectively while using less memory ( and generating less garbage collection ).