Bug 39635

Summary: Improve canvas perf test accuracy.
Product: WebKit Reporter: David Levin <levin>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mjs
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch mjs: review+

Description David Levin 2010-05-24 18:09:40 PDT
Improve canvas perf test fairness.
Comment 1 David Levin 2010-05-24 18:13:45 PDT
Created attachment 56953 [details]
Patch
Comment 2 David Levin 2010-05-24 18:17:19 PDT
With these changes the results in chromium are nearly unchanged, but now the results from the gpu enabled firefox show how long the underlying operations really take.

From my run with Firefox 3.7a4 with the DirectX enabled:
  Direct image copy: 93.5ms
  Indirect copy with (via ImageData): 121.25ms
  Copy with 2x scale: 492ms
  Copy with 0.5x scale 171ms
  Copy with rotate: 10.5 ms
Comment 3 David Levin 2010-05-24 23:58:14 PDT
Created attachment 56981 [details]
Patch
Comment 4 David Levin 2010-05-25 00:17:00 PDT
From last time, I remove the scale calls that I was sure were needed but apparently were not. (I must have made a mistake in the Javascript code with the context I was using when I hit this issue.)

I fixed a few issues in my last patch:

>  output.innerHTML += "Indirect copy with (via ImageData): " + (time/2) + "ms<br>";
                                                                                                                    ^^^^ the /2 shouldn't be here.


>     time = (new Date()) - startDate;
Old time calculation was present before the result for 0.5 scale.

>  time = timeCanvasOperation(scaledDownContext,
                                                       ^^^^ flushing the wrong context.
>          function () {
>              rotatedContext.drawImage(original, 0, -original.height);
>          });

As such the results changed to more accurately reflect perf, for Firefox 3.7a4
  Direct image copy: 96ms
  Indirect copy with (via ImageData): 346ms (No longer dividing by 2 when we shouldn't)
  Copy with 2x scale: 277ms (likely lower due to allowing garbage collection)
  Copy with 0.5x scale: 44ms (now calc'ing time correctly with subtracting out the overhead)
  Copy with rotate: 120 ms (now flushing the correct context)
Comment 5 Maciej Stachowiak 2010-05-25 00:36:55 PDT
Comment on attachment 56981 [details]
Patch

r=me
Comment 6 David Levin 2010-05-25 00:49:01 PDT
Committed as http://trac.webkit.org/changeset/60140