Last Comment Bug 722164 - Investigate Azure Quartz Interpolation Quality
: Investigate Azure Quartz Interpolation Quality
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: 12 Branch
: All All
: -- normal (vote)
: mozilla12
Assigned To: Benoit Girard (:BenWa)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-29 08:28 PST by Benoit Girard (:BenWa)
Modified: 2012-01-31 07:01 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Turn off interpolation (829 bytes, patch)
2012-01-29 08:32 PST, Benoit Girard (:BenWa)
no flags Details | Diff | Splinter Review
Quartz Interpolate Pref (1.92 KB, patch)
2012-01-29 14:09 PST, Benoit Girard (:BenWa)
no flags Details | Diff | Splinter Review
Switch to kCGInterpolationLow (1.96 KB, patch)
2012-01-29 20:29 PST, Benoit Girard (:BenWa)
jmuizelaar: review+
Details | Diff | Splinter Review

Description Benoit Girard (:BenWa) 2012-01-29 08:28:18 PST

    
Comment 1 Benoit Girard (:BenWa) 2012-01-29 08:32:05 PST
Created attachment 592508 [details] [diff] [review]
Turn off interpolation

Turning off interpolation gives me massive improvements in canvas performance. I was able to run 100 Fishes at 40 FPS. I did a similar experiment with cairo and also saw significant performance improvements. I noticed this because interpolation was showing up in profiles
Comment 2 Bas Schouten (:bas.schouten) 2012-01-29 08:46:04 PST
This isn't surprising, but I'm not sure it's desirable though. Maybe we could go to linear from the I believe Lanczos Quartz is currently doing?
Comment 3 Jeff Muizelaar [:jrmuizel] 2012-01-29 13:41:45 PST
We should be able to use kCGInterpolationMedium on systems that support it.
Comment 4 Joe Drew (not getting mail) 2012-01-29 13:47:10 PST
I'd be great with using Low (or Medium maybe) interpolation on canvas only. Depending on the quality, it's possible we could switch to Medium for all web content.
Comment 5 Benoit Girard (:BenWa) 2012-01-29 14:09:32 PST
Created attachment 592543 [details] [diff] [review]
Quartz Interpolate Pref
Comment 6 Benoit Girard (:BenWa) 2012-01-29 14:28:24 PST
Testcase: http://ie.microsoft.com/testdrive/performance/fishietank/
100 Fishes

Note: High is 3, Medium is 4. The FPS is very rough since the scaling of the fishes has a big impact on the FPS.

Values:
http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Reference/CGContext/Reference/reference.html#//apple_ref/c/tdef/CGInterpolationQuality

gfx.canvas.azure.quartz.interpolation = kCGInterpolationDefault = 0
8-9 FPS
Profile: http://varium.fantasytalesonline.com/cleopatra/?report=AMIfv97lt1xGt6kPtsEvINA4-KrFyQl-mwSvcrm5dAJ3S4gaBRnqvfxMuhSOZaGSAMYU7gb1jSwPkgy78d44X6WtWNDU9ldg05zQqmlel0z1cxKc7fSyIP8VJZBjuc_ePBXS9YXhxq5OKu17BmoKOvTIuuqyMJmTmA
Top Sample: (34.07%) resample_band (in CoreGraphics) + 1108

gfx.canvas.azure.quartz.interpolation = kCGInterpolationNone = 1
36-40 FPS
Profile: http://varium.fantasytalesonline.com/cleopatra/?report=AMIfv97G4QE4tZ0C_QNVYIJGmUlqCFkuh2X8gSJ2uGaJSXeMs6_CNbgPZTfHraLeKA70V7x33uDPWOa4WP2lxRWUgYIgj2ypdvWceRaQg-X2Clyf3Okp7gfEq8sggBDBFpKzlSCLCLkWh_mUGd4xvQsMkV3aBcEwZA
Top Sample: (7.85%) argb32_image_mark (in CoreGraphics) + 1036

gfx.canvas.azure.quartz.interpolation = kCGInterpolationLow = 2
25-38 FPS
Profile: http://varium.fantasytalesonline.com/cleopatra/?report=AMIfv97ObqbQl1WgrqA4gcxAhqusEbfDSbRh5YEnrPVimMIWRRkzg9V3ZDFXELnRF0Vc5CWv19g8gdYuEg_vr5IjLmcLW3Dp0NTMmYhuBJEsBK4uJhqKuAZkI7SX_r6Uq9OGbHWbg43cTybXwQGAqaOPHQ_4QHUITQ
Top Sample: (24.88%) argb32_image_mark (in CoreGraphics) + 1036

gfx.canvas.azure.quartz.interpolation = kCGInterpolationHigh = 3
9-11 FPS
Profile: http://varium.fantasytalesonline.com/cleopatra/?report=AMIfv95W2sC5rvzRyXojF7fuHDMtl2oLHm-Bz3rUGOxVkEi8NLUNYHhzAA2HUXeJW4Grjzfvz_ddCSqL8hvFbEB0fV0x7s-v6mkryk_0tZOgwmczLWtYD9FCTWliGUR9EsMqqxPHCZqC3vAI1jdnTjbi7qxqn0vRjQ
Top Sample: (25.62%) resample_band (in CoreGraphics) + 1108

gfx.canvas.azure.quartz.interpolation = kCGInterpolationMedium = 4
9-20 FPS
Profile: http://varium.fantasytalesonline.com/cleopatra/?report=AMIfv96KLTU4eTaRkIuC4XSjxBA6ogORaVDDyK0bJvMoja2y6RaefOazW9vf6Ig3RZu2ZqaAEMMZ3NoSMH3jtWdeYyoEfT6n8rbmxeJQhu4RFOn5cwer2mdP2QTl6h-UeYmSIshBBw07xt1_LCbN0uBRcH2dtKIv-A
Top Sample: (19.84%) resample_band (in CoreGraphics) + 1108
Comment 7 Benoit Girard (:BenWa) 2012-01-29 14:31:03 PST
kCGInterpolationDefault is most likely high.
We only hit resample_band on Medium and higher and loose FPS significantly. Presumably that's Lanczos. We should consider using either Low or None.
Comment 8 Benoit Girard (:BenWa) 2012-01-29 20:29:37 PST
Created attachment 592602 [details] [diff] [review]
Switch to kCGInterpolationLow

We should aim to land this Monday for the aurora merge since this is low risk and big performance impact.
Comment 9 Jeff Muizelaar [:jrmuizel] 2012-01-30 12:50:20 PST
Comment on attachment 592602 [details] [diff] [review]
Switch to kCGInterpolationLow

Add a comment about how we only want to do this for canvas. Add perhaps an API proposal.
Comment 11 Ed Morley [:emorley] 2012-01-31 07:01:10 PST
https://hg.mozilla.org/mozilla-central/rev/bf005f6e4d5f

Note You need to log in before you can comment on or make changes to this bug.