[Webkit-unassigned] [Bug 50804] [chromium] Reduce canvas.toDataURL("image/jpeg") run-time cost by 10%

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 12 17:40:44 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=50804





--- Comment #8 from noel gordon <noel.gordon at gmail.com>  2010-12-12 17:40:43 PST ---
(In reply to comment #7)
> (From update of attachment 76174 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=76174&action=review
> 
> It's a little surprising that this unroll makes things faster, but OK.   Are you certain in the stability of your numbers?

Test image is 1800 x 1350 px JPEG.  I load it into a <canvas> and then I do back-to-back canvas.toDataURL("image/jpeg")
calls in js, logging the time as I go.  My results are:

Safari 5.0.2 win32 (7533.18.5):
 12:15:45:062 extract image/jpeg 145 ms length: 667763 bytes
 12:15:45:214 extract image/jpeg 146 ms length: 667763 bytes
 12:15:45:366 extract image/jpeg 146 ms length: 667763 bytes
 12:15:45:517 extract image/jpeg 145 ms length: 667763 bytes
 12:15:45:668 extract image/jpeg 145 ms length: 667763 bytes
 12:15:45:819 extract image/jpeg 144 ms length: 667763 bytes
 12:15:45:970 extract image/jpeg 144 ms length: 667763 bytes
 12:15:46:122 extract image/jpeg 145 ms length: 667763 bytes
 12:15:46:273 extract image/jpeg 145 ms length: 667763 bytes
 12:15:46:424 extract image/jpeg 145 ms length: 667763 bytes
 12:15:46:575 extract image/jpeg 144 ms length: 667763 bytes

Chrome ToT win32:
 12:09:16:144 extract image/jpeg 129 ms length: 630179 bytes
 12:09:16:301 extract image/jpeg 130 ms length: 630179 bytes
 12:09:16:458 extract image/jpeg 130 ms length: 630179 bytes
 12:09:16:617 extract image/jpeg 130 ms length: 630179 bytes
 12:09:16:752 extract image/jpeg 130 ms length: 630179 bytes
 12:09:16:909 extract image/jpeg 129 ms length: 630179 bytes
 12:09:17:044 extract image/jpeg 129 ms length: 630179 bytes
 12:09:17:203 extract image/jpeg 130 ms length: 630179 bytes
 12:09:17:339 extract image/jpeg 130 ms length: 630179 bytes
 12:09:17:474 extract image/jpeg 130 ms length: 630179 bytes
 12:09:17:632 extract image/jpeg 130 ms length: 630179 bytes

Chrome ToT win32 with this change:
 12:13:14:649 extract image/jpeg 115 ms length: 630179 bytes
 12:13:14:769 extract image/jpeg 115 ms length: 630179 bytes
 12:13:14:891 extract image/jpeg 114 ms length: 630179 bytes
 12:13:15:011 extract image/jpeg 114 ms length: 630179 bytes
 12:13:15:131 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:253 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:373 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:494 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:617 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:738 extract image/jpeg 115 ms length: 630179 bytes
 12:13:15:857 extract image/jpeg 114 ms length: 630179 bytes

worth it?

> > WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp:90
> > +        if ((alpha != 0) && (alpha != 255)) {
> 
> We generally use just "alpha" instead of "alpha != 0", but it might be OK here.

agree, OK here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list