[Webkit-unassigned] [Bug 89248] [cairo] simplify copyCairoImageSurface

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 26 17:32:44 PDT 2012


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





--- Comment #7 from Martin Robinson <mrobinson at webkit.org>  2012-06-26 17:32:43 PST ---
(In reply to comment #5)
> (In reply to comment #3)
> > Does this change show a measurable performance improvement?
> 
> http://renevier.net/misc/webkit_89248.html
> Currently GtkLauncher, display on average on startup:
> 
> 10px*10px; 100000 iterations: 450ms
> 100px*100px; 10000 iterations: 260ms
> 1000px*1000px; 100 iterations: 180ms

> with the patch, times are:
> 
> 10px*10px; 100000 iterations: 240ms
> 100px*100px; 10000 iterations: 215ms
> 1000px*1000px; 100 iterations: 210ms

So time saved per iteration is:

(450 - 240) / 100000 = 0.0021 ms = 2.1 microseconds
(215 - 115) / 10000 = 0.01 ms = 10 microseconds
(210 - 180) / 100 = 0.3 ms = 300 microseconds

> after a few page reloads, times are:
> 
> 10px*10px; 100000 iterations: 350ms
> 100px*100px; 10000 iterations: 115ms
> 1000px*1000px; 100 iterations: 110ms
> 
> and after a few page reloads:
> 
> 10px*10px; 100000 iterations: 160ms
> 100px*100px; 10000 iterations: 70ms
> 1000px*1000px; 100 iterations: 45ms

(350 - 160) / 100000 = 0.0019 ms = 1.9 microseconds
(115 - 70) / 10000 = 0.0045 ms = 4.5 microseconds
(110 - 45) / 100 = 0.65 ms = 650 microseconds

So it seems that, in the best case, we save just over one half of a millisecond and that's with the creation of a very large pattern. I would feel much better about this kind of micro-optimization if it showed some kind of user-observable speedup. 

There's a benefit to abstraction and using the API of your dependencies. I think that benefit outweighs the benefit of micro-optimization when the optimization has little effect on the user experience.

If this change improves the performance of content in the wild, then perhaps I'll change my tune. It seems there is much more lower hanging fruit though.

-- 
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