Use more ES6 features in JSAir
[WebKit.git] / PerformanceTests / ChangeLog
1 2016-06-08  Filip Pizlo  <fpizlo@apple.com>
2
3         Use more ES6 features in JSAir
4         https://bugs.webkit.org/show_bug.cgi?id=158497
5
6         Reviewed by Keith Miller.
7         
8         This improves JSAir with the following ES6 features suggested by JoePeck:
9         
10         - String interpolation.
11         - Destructuring inside PatchCustom.
12         - Default arguments.
13         
14         All of these things are on hot paths.
15         
16         Note that I didn't use string interpolation everywhere that I could, only in those places
17         where it made the code more readable. In Ruby, I used the style that if the interpolation
18         expression has any non-trivial stuff (like a ternary operator, a chain of calls, or embedded
19         strings) then it's better to use regular strcat. I think that's what I carried over to here.
20         
21         Note that the previous change (Add result validation to JSAir) also made the Proxy code not
22         dead, though it's not necessarily on the hot path. The Proxy isn't called into frequently
23         but it's used from a function that is otherwise hot, so if calling into the Proxy prevents
24         that function from being optimized then it will hurt so good.
25         
26         I also reenabled tail calls in a few places.
27         
28         This change doesn't seem to change the performance of the benchmark for us. That's expected
29         since these ES6 features are cheap. Note that this claim doesn't include Proxy, which was
30         added in a separate change and that change did make the benchmark overall more expensive.
31
32         * JSAir/allocate_stack.js:
33         (allocateStack):
34         * JSAir/arg.js:
35         (Arg.createBitImm64):
36         (Arg.createAddr):
37         (Arg.createStack):
38         (Arg.logScale):
39         (Arg.createIndex):
40         * JSAir/basic_block.js:
41         (BasicBlock.get headerString):
42         (BasicBlock.prototype.get if):
43         (BasicBlock):
44         * JSAir/benchmark.js:
45         (benchmark):
46         * JSAir/code.js:
47         (Code):
48         (Code.prototype.addBlock):
49         (Code.prototype.addStackSlot):
50         (Code.prototype.newTmp):
51         (Code.prototype.get size):
52         (Code.prototype.get blocks):
53         (Code.prototype.get stackSlots):
54         (Code.prototype.tmps):
55         (Code.prototype.get callArgAreaSize):
56         (Code.prototype.toString):
57         * JSAir/custom.js:
58         (const.PatchCustom.forEachArg):
59         * JSAir/inst.js:
60         (Inst):
61         * JSAir/reg.js:
62         (Reg.prototype.toString):
63         * JSAir/util.js:
64         (symbolName):
65         (lowerSymbolName):
66
67 2016-06-07  Filip Pizlo  <fpizlo@apple.com>
68
69         Add result validation to JSAir
70         https://bugs.webkit.org/show_bug.cgi?id=158493
71
72         Reviewed by Saam Barati.
73         
74         This adds the ability to hash a Code in a way that matches the C++ code's hashing of Code.
75         This allows us to check if the Code that JSAir sees is the code that C++ saw. We use this to
76         check the Code before and after allocateStack, and compare against hashes we got from C++.
77         
78         Doing this uncovered bugs. roundUpToMultipleOf wasn't doing anything. allocateStack was not
79         allocating things correctly because I was concatting a Set to an Array, which doesn't really
80         work. Now these bugs are fixed.
81         
82         The checking step adds to the running time so I reduced the number of iterations. The
83         benchmark spends a decent amount of its time computing Code hashes; I think it's around 1/3
84         total. This is probably OK. It's better to verify the results even if the running time is
85         not all in the "core" of the algorithm.
86         
87         Also add a run-jsc-stress-tests yaml file to allow this to run as a test.
88
89         * JSAir/allocate_stack.js:
90         * JSAir/arg.js:
91         (Arg.createImm):
92         (Arg.createBigImm):
93         (Arg.createBitImm):
94         (Arg.createBitImm64):
95         (Arg.createWidth):
96         (Arg.createSpecial):
97         (Arg.prototype.get kind):
98         (Arg.prototype.get isTmp):
99         (Arg.prototype.get isImm):
100         (Arg.prototype.get isSomeImm):
101         (Arg.prototype.get isSomeBigImm):
102         (Arg.prototype.get isCondition):
103         (Arg.prototype.get isWidth):
104         (Arg.prototype.get isSpecial):
105         (Arg.prototype.get isAlive):
106         (Arg.prototype.get tmp):
107         (Arg.prototype.get value):
108         (Arg.prototype.get lowValue):
109         (Arg.prototype.get highValue):
110         (Arg.prototype.get base):
111         (Arg.prototype.get isGP):
112         (Arg.prototype.get isFP):
113         (Arg.prototype.isValidForm):
114         (Arg.prototype.get isInvertible):
115         (Arg.kindCode):
116         (Arg.prototype.hash):
117         (Arg.prototype.toString):
118         (Arg):
119         * JSAir/basic_block.js:
120         (BasicBlock.get successorBlocks):
121         * JSAir/benchmark.js:
122         (benchmark):
123         * JSAir/code.js:
124         (Code.prototype.setFrameSize):
125         (Code.prototype.hash):
126         (Code.prototype.toString):
127         (Code):
128         * JSAir/inst.js:
129         (Inst.prototype.get hasNonArgEffects):
130         (Inst.prototype.hash):
131         (Inst.prototype.toString):
132         (Inst):
133         * JSAir/jsair-tests.yaml: Added.
134         * JSAir/opcode.js:
135         (Inst_forEachArg):
136         (Inst_hasNonArgEffects):
137         (opcodeCode):
138         * JSAir/payload-gbemu-executeIteration.js:
139         (createPayloadGbemuExecuteIteration):
140         * JSAir/payload-imaging-gaussian-blur-gaussianBlur.js:
141         (createPayloadImagingGaussianBlurGaussianBlur):
142         * JSAir/payload-jsair-ACLj8C.js:
143         (createPayloadJSAirACLj8C):
144         * JSAir/payload-typescript-scanIdentifier.js:
145         (createPayloadTypescriptScanIdentifier):
146         * JSAir/reg.js:
147         (Reg.prototype.get isReg):
148         (Reg.prototype.hash):
149         (Reg.prototype.toString):
150         * JSAir/stack_slot.js:
151         (StackSlot.prototype.setOffsetFromFP):
152         (StackSlot.prototype.hash):
153         (StackSlot.prototype.toString):
154         * JSAir/symbols.js:
155         (relCondCode):
156         (resCondCode):
157         (doubleCondCode):
158         * JSAir/test.html:
159         * JSAir/tmp.js:
160         (Tmp.prototype.get isReg):
161         (Tmp.prototype.hash):
162         (Tmp.prototype.toString):
163         * JSAir/util.js:
164         (roundUpToMultipleOf):
165         (symbolName):
166
167 2016-06-07  Filip Pizlo  <fpizlo@apple.com>
168
169         Implement Air::allocateStack() in ES6 to see how much of a bad idea that is
170         https://bugs.webkit.org/show_bug.cgi?id=158318
171
172         Reviewed by Saam Barati.
173         
174         This adds a new benchmark for us to play with called JSAir. It's a complete ES6
175         implementation of Air's allocateStack() phase along with all of Air needed to run that
176         phase. This includes things like stack slots, registers, temporaries, basic blocks,
177         instructions, and all of the code for iterating over, inspecting, and modifying those
178         things.
179         
180         To make this work, JSC can now dump Air just before allocateStack() in the form of JS code
181         that creates a Code object that matches exactly what C++ Air saw. This benchmark comprises
182         four Air IRs:
183         
184         - Octane/gbemu's largest function, executeIteration.
185         - Kraken/imaging-gaussian-blur's largest function in OSR entry mode, gaussuanBlur.
186         - Octane/typescript's largest function that is actually hot, scanIdentifier.
187         - JSAir's largest hot function, which is anonymous, so we call it by its hash (ACLj8C).
188         
189         This runs in about 2 seconds on my machine in JSC trunk. It includes both a commandline
190         harness and a web harness. JSAir is almost exactly 100x slower in ES6 in WebKit than the
191         C++ Air::allocateStack() phase on which it is based.
192         
193         JSAir uses the following ES6 features:
194         
195         - Symbol.
196         - for-of.
197         - arrow functions.
198         - Map/Set.
199         - let/const.
200         - classes.
201         
202         All of these things are used in anger and should end up on the hot path. There is also code
203         that uses Proxies, but it ends up being dead.
204         
205         We can improve this even more:
206         I still need to add result validation: https://bugs.webkit.org/show_bug.cgi?id=158493
207         I want to make it use more ES6 features: https://bugs.webkit.org/show_bug.cgi?id=158497
208         
209         * JSAir: Added.
210         * JSAir/all.js: Added.
211         * JSAir/allocate_stack.js: Added.
212         (allocateStack.attemptAssignment):
213         (allocateStack.assign):
214         (allocateStack.interfere):
215         (allocateStack.):
216         (allocateStack):
217         * JSAir/arg.js: Added.
218         (Arg):
219         (Arg.isAnyUse):
220         (Arg.isColdUse):
221         (Arg.isWarmUse):
222         (Arg.cooled):
223         (Arg.isEarlyUse):
224         (Arg.isLateUse):
225         (Arg.isAnyDef):
226         (Arg.isEarlyDef):
227         (Arg.isLateDef):
228         (Arg.isZDef):
229         (Arg.typeForB3Type):
230         (Arg.widthForB3Type):
231         (Arg.conservativeWidth):
232         (Arg.minimumWidth):
233         (Arg.bytes):
234         (Arg.widthForBytes):
235         (Arg.createTmp):
236         (Arg.fromReg):
237         (Arg.createImm):
238         (Arg.createBigImm):
239         (Arg.createBitImm):
240         (Arg.createBitImm64):
241         (Arg.createAddr):
242         (Arg.createStack):
243         (Arg.createCallArg):
244         (Arg.createStackAddr):
245         (Arg.isValidScale):
246         (Arg.logScale):
247         (Arg.createIndex):
248         (Arg.createRelCond):
249         (Arg.createResCond):
250         (Arg.createDoubleCond):
251         (Arg.createWidth):
252         (Arg.prototype.get kind):
253         (Arg.prototype.get isTmp):
254         (Arg.prototype.get isImm):
255         (Arg.prototype.get isBigImm):
256         (Arg.prototype.get isBitImm):
257         (Arg.prototype.get isBitImm64):
258         (Arg.prototype.get isSomeImm):
259         (Arg.prototype.get isAddr):
260         (Arg.prototype.get isStack):
261         (Arg.prototype.get isCallArg):
262         (Arg.prototype.get isIndex):
263         (Arg.prototype.get isMemory):
264         (Arg.prototype.get isStackMemory):
265         (Arg.prototype.get isRelCond):
266         (Arg.prototype.get isResCond):
267         (Arg.prototype.get isDoubleCond):
268         (Arg.prototype.get isCondition):
269         (Arg.prototype.get isWidth):
270         (Arg.prototype.get isAlive):
271         (Arg.prototype.get tmp):
272         (Arg.prototype.get value):
273         (Arg.prototype.get base):
274         (Arg.prototype.get hasOffset):
275         (Arg.prototype.get offset):
276         (Arg.prototype.get stackSlot):
277         (Arg.prototype.get index):
278         (Arg.prototype.get scale):
279         (Arg.prototype.get logScale):
280         (Arg.prototype.get width):
281         (Arg.prototype.get isGPTmp):
282         (Arg.prototype.get isFPTmp):
283         (Arg.prototype.get isGP):
284         (Arg.prototype.get isFP):
285         (Arg.prototype.get hasType):
286         (Arg.prototype.get type):
287         (Arg.prototype.isType):
288         (Arg.prototype.isCompatibleType):
289         (Arg.prototype.get isGPR):
290         (Arg.prototype.get gpr):
291         (Arg.prototype.get isFPR):
292         (Arg.prototype.get fpr):
293         (Arg.prototype.get isReg):
294         (Arg.prototype.get reg):
295         (Arg.isValidImmForm):
296         (Arg.isValidBitImmForm):
297         (Arg.isValidBitImm64Form):
298         (Arg.isValidAddrForm):
299         (Arg.isValidIndexForm):
300         (Arg.prototype.isValidForm):
301         (Arg.prototype.forEachTmpFast):
302         (Arg.prototype.usesTmp):
303         (Arg.prototype.forEachTmp):
304         (Arg.prototype.is):
305         (Arg.prototype.as):
306         (Arg.prototype.forEachFast):
307         (Arg.prototype.forEach):
308         (Arg.extract):
309         (Arg.forEachFast):
310         (Arg.forEach):
311         (Arg.prototype.get condition):
312         (Arg.prototype.get isInvertible):
313         (Arg.prototype.toString):
314         * JSAir/basic_block.js: Added.
315         (BasicBlock):
316         (BasicBlock.prototype.get index):
317         (BasicBlock.prototype.get size):
318         (BasicBlock.prototype.Symbol.iterator):
319         (BasicBlock.prototype.at):
320         (BasicBlock.get last):
321         (BasicBlock.get insts):
322         (BasicBlock.get numSuccessors):
323         (BasicBlock.get successors):
324         (BasicBlock.get successorBlocks.):
325         (BasicBlock.get successorBlocks):
326         (BasicBlock.set get numPredecessors):
327         (BasicBlock.get predecessors):
328         (BasicBlock.get frequency):
329         (BasicBlock.get headerString):
330         (BasicBlock.get footerString):
331         * JSAir/benchmark.js: Added.
332         (benchmark):
333         * JSAir/code.js: Added.
334         (Code):
335         (Code.prototype.addBlock):
336         (Code.prototype.addStackSlot):
337         (Code.prototype.newTmp):
338         (Code.prototype.get size):
339         (Code.prototype.at):
340         (Code.prototype.Symbol.iterator):
341         (Code.prototype.get blocks):
342         (Code.prototype.get stackSlots):
343         (Code.prototype.tmps):
344         (Code.prototype.get callArgAreaSize):
345         (Code.prototype.requestCallArgAreaSize):
346         (Code.prototype.get frameSize):
347         (Code.prototype.setFrameSize):
348         (Code.prototype.toString):
349         * JSAir/custom.js: Added.
350         (const.ShuffleCustom.forEachArg):
351         (const.ShuffleCustom.hasNonArgNonControlEffects):
352         (const.PatchCustom.forEachArg):
353         (const.PatchCustom.hasNonArgNonControlEffects):
354         (const.CCallCustom.forEachArg):
355         (const.CCallCustom.hasNonArgNonControlEffects):
356         (const.ColdCCallCustom.forEachArg):
357         (const.ColdCCallCustom.hasNonArgNonControlEffects):
358         * JSAir/frequented_block.js: Added.
359         (FrequentedBlock):
360         (FrequentedBlock.prototype.toString):
361         * JSAir/insertion_set.js: Added.
362         (Insertion):
363         (Insertion.prototype.get index):
364         (Insertion.prototype.get element):
365         (Insertion.prototype.lessThan):
366         (InsertionSet):
367         (InsertionSet.prototype.appendInsertion):
368         (InsertionSet.prototype.append):
369         (InsertionSet.prototype.execute):
370         * JSAir/inst.js: Added.
371         (Inst):
372         (Inst.prototype.append):
373         (Inst.prototype.clear):
374         (Inst.prototype.get opcode):
375         (Inst.prototype.get args):
376         (Inst.prototype.visitArg):
377         (Inst.prototype.forEachTmpFast):
378         (Inst.prototype.forEachArg):
379         (Inst.prototype.forEachTmp):
380         (Inst.prototype.forEach):
381         (Inst.forEachDef):
382         (Inst.forEachDefWithExtraClobberedRegs):
383         (Inst.prototype.get hasNonArgEffects):
384         (Inst.prototype.toString):
385         * JSAir/liveness.js: Added.
386         (Liveness):
387         (Liveness.prototype.get thing):
388         (Liveness.prototype.get code):
389         (Liveness.prototype.get liveAtHead):
390         (Liveness.prototype.get liveAtTail):
391         (Liveness.prototype.localCalc.LocalCalc):
392         (Liveness.prototype.localCalc.LocalCalc.prototype.get liveSet):
393         (Liveness.prototype.localCalc.LocalCalc.prototype.execute):
394         (Liveness.prototype.localCalc):
395         * JSAir/opcode.js: Added.
396         (Inst_forEachArg):
397         (Inst_hasNonArgEffects):
398         * JSAir/payload-gbemu-executeIteration.js: Added.
399         (createPayloadGbemuExecuteIteration):
400         * JSAir/payload-imaging-gaussian-blur-gaussianBlur.js: Added.
401         (createPayloadImagingGaussianBlurGaussianBlur):
402         * JSAir/payload-jsair-ACLj8C.js: Added.
403         (createPayloadJSAirACLj8C):
404         * JSAir/payload-typescript-scanIdentifier.js: Added.
405         (createPayloadTypescriptScanIdentifier):
406         * JSAir/reg.js: Added.
407         (Reg):
408         (Reg.fromReg):
409         (Reg.prototype.get index):
410         (Reg.prototype.get type):
411         (Reg.prototype.get name):
412         (Reg.prototype.get isCalleeSave):
413         (Reg.prototype.get isReg):
414         (Reg.prototype.toString):
415         (Reg.extract):
416         (Reg.forEachFast):
417         (Reg.forEach):
418         (newGPR):
419         (Reg.gprs.Reg.fprs.Reg.calleeSaveGPRs.Reg.calleeSaveFPRs.Reg.calleeSaves):
420         * JSAir/stack_slot.js: Added.
421         (StackSlot):
422         (StackSlot.prototype.get byteSize):
423         (StackSlot.prototype.get kind):
424         (StackSlot.prototype.get isLocked):
425         (StackSlot.prototype.get isSpill):
426         (StackSlot.prototype.get index):
427         (StackSlot.prototype.ensureSize):
428         (StackSlot.prototype.get alignment):
429         (StackSlot.prototype.get offsetFromFP):
430         (StackSlot.prototype.setOffsetFromFP):
431         (StackSlot.prototype.toString):
432         (StackSlot.extract):
433         (StackSlot.forEachFast):
434         (StackSlot.forEach):
435         * JSAir/symbols.js: Added.
436         * JSAir/test.html: Added.
437         * JSAir/test.js: Added.
438         * JSAir/tmp.js: Added.
439         (Tmp):
440         (Tmp.fromReg):
441         (Tmp.prototype.get index):
442         (Tmp.prototype.get type):
443         (Tmp.prototype.get isReg):
444         (Tmp.prototype.toString):
445         (Tmp.extract):
446         (Tmp.forEachFast):
447         (Tmp.forEach):
448         * JSAir/tmp_base.js: Added.
449         (TmpBase.prototype.get isGP):
450         (TmpBase.prototype.get isFP):
451         (TmpBase.prototype.get isGPR):
452         (TmpBase.prototype.get isFPR):
453         (TmpBase.prototype.get reg):
454         (TmpBase.prototype.get gpr):
455         (TmpBase.prototype.get fpr):
456         (TmpBase):
457         * JSAir/util.js: Added.
458         (isRepresentableAsInt32):
459         (addIndexed):
460         (roundUpToMultipleOf):
461         (symbolName):
462         (mergeIntoSet):
463         (nonEmptyRangesOverlap):
464         (rangesOverlap):
465         (removeAllMatching):
466         (swap):
467         (bubble):
468         (bubbleSort):
469         (currentTime):
470         (else.currentTime):
471
472 2016-05-26  Yusuke Suzuki  <utatane.tea@gmail.com>
473
474         [JSC] Allow JSBench to use precise time
475         https://bugs.webkit.org/show_bug.cgi?id=158050
476
477         Reviewed by Geoffrey Garen.
478
479         * JSBench/amazon-chrome-win/urem.js:
480         (else.window.performance.window.performance.now.currentTimeInMS):
481         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
482         (else.else.currentTimeInMS):
483         (onload.cb):
484         (onload):
485         * JSBench/amazon-chrome/urem.js:
486         (else.window.performance.window.performance.now.currentTimeInMS):
487         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
488         (else.else.currentTimeInMS):
489         (onload.cb):
490         (onload):
491         * JSBench/amazon-firefox-win/urm.js:
492         (else.window.performance.window.performance.now.currentTimeInMS):
493         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
494         (else.else.currentTimeInMS):
495         (onload.cb):
496         (onload):
497         * JSBench/amazon-firefox/urm.js:
498         (else.window.performance.window.performance.now.currentTimeInMS):
499         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
500         (else.else.currentTimeInMS):
501         (onload.cb):
502         (onload):
503         * JSBench/amazon-safari/urem.js:
504         (else.window.performance.window.performance.now.currentTimeInMS):
505         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
506         (else.else.currentTimeInMS):
507         (onload.cb):
508         (onload):
509         * JSBench/facebook-chrome-win/urem.js:
510         (else.window.performance.window.performance.now.currentTimeInMS):
511         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
512         (else.else.currentTimeInMS):
513         (onload.cb):
514         (onload):
515         * JSBench/facebook-chrome/urem.js:
516         (else.window.performance.window.performance.now.currentTimeInMS):
517         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
518         (else.else.currentTimeInMS):
519         (onload.cb):
520         (onload):
521         * JSBench/facebook-firefox-win/urem.js:
522         (else.window.performance.window.performance.now.currentTimeInMS):
523         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
524         (else.else.currentTimeInMS):
525         (onload.cb):
526         (onload):
527         * JSBench/facebook-firefox/urem.js:
528         (else.window.performance.window.performance.now.currentTimeInMS):
529         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
530         (else.else.currentTimeInMS):
531         (onload.cb):
532         (onload):
533         * JSBench/facebook-safari/urem.js:
534         (else.window.performance.window.performance.now.currentTimeInMS):
535         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
536         (else.else.currentTimeInMS):
537         (onload.cb):
538         (onload):
539         * JSBench/google-chrome-win/urem.js:
540         (else.window.performance.window.performance.now.currentTimeInMS):
541         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
542         (else.else.currentTimeInMS):
543         (onload.cb):
544         (onload):
545         * JSBench/google-chrome/urem.js:
546         (else.window.performance.window.performance.now.currentTimeInMS):
547         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
548         (else.else.currentTimeInMS):
549         (onload.cb):
550         (onload):
551         * JSBench/google-firefox-win/urem.js:
552         (else.window.performance.window.performance.now.currentTimeInMS):
553         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
554         (else.else.currentTimeInMS):
555         (onload.cb):
556         (onload):
557         * JSBench/google-firefox/uem.js:
558         (else.window.performance.window.performance.now.currentTimeInMS):
559         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
560         (else.else.currentTimeInMS):
561         (onload.cb):
562         (onload):
563         * JSBench/google-safari/urem.js:
564         (else.window.performance.window.performance.now.currentTimeInMS):
565         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
566         (else.else.currentTimeInMS):
567         (onload.cb):
568         (onload):
569         * JSBench/harness.js:
570         (runBenchmark.window.currentTimeInMS):
571         (runBenchmark.else.window.currentTimeInMS):
572         * JSBench/twitter-chrome-win/rem.js:
573         (else.window.performance.window.performance.now.currentTimeInMS):
574         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
575         (else.else.currentTimeInMS):
576         (onload.cb):
577         (onload):
578         * JSBench/twitter-chrome/urem.js:
579         (else.window.performance.window.performance.now.currentTimeInMS):
580         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
581         (else.else.currentTimeInMS):
582         (onload.cb):
583         (onload):
584         * JSBench/twitter-firefox-win/urem.js:
585         (else.window.performance.window.performance.now.currentTimeInMS):
586         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
587         (else.else.currentTimeInMS):
588         (onload.cb):
589         (onload):
590         * JSBench/twitter-firefox/urem.js:
591         (else.window.performance.window.performance.now.currentTimeInMS):
592         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
593         (else.else.currentTimeInMS):
594         (onload.cb):
595         (onload):
596         * JSBench/twitter-safari/urem.js:
597         (else.window.performance.window.performance.now.currentTimeInMS):
598         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
599         (else.else.currentTimeInMS):
600         (onload.cb):
601         (onload):
602         * JSBench/yahoo-chrome-win/urem.js:
603         (else.window.performance.window.performance.now.currentTimeInMS):
604         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
605         (else.else.currentTimeInMS):
606         (onload.cb):
607         (onload):
608         * JSBench/yahoo-chrome/urem.js:
609         (else.window.performance.window.performance.now.currentTimeInMS):
610         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
611         (else.else.currentTimeInMS):
612         (onload.cb):
613         (onload):
614         * JSBench/yahoo-firefox-win/urem.js:
615         (else.window.performance.window.performance.now.currentTimeInMS):
616         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
617         (else.else.currentTimeInMS):
618         (onload.cb):
619         (onload):
620         * JSBench/yahoo-firefox/urem.js:
621         (else.window.performance.window.performance.now.currentTimeInMS):
622         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
623         (else.else.currentTimeInMS):
624         (onload.cb):
625         (onload):
626         * JSBench/yahoo-safari/urem.js:
627         (else.window.performance.window.performance.now.currentTimeInMS):
628         (else.else.typeof.preciseTime.string_appeared_here.currentTimeInMS):
629         (else.else.currentTimeInMS):
630         (onload.cb):
631         (onload):
632
633 2016-05-25  Geoffrey Garen  <ggaren@apple.com>
634
635         replaceable own properties seem to ignore replacement after property caching
636         https://bugs.webkit.org/show_bug.cgi?id=158091
637
638         Reviewed by Darin Adler.
639
640         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
641         * MallocBench/MallocBench/Benchmark.cpp:
642         * MallocBench/MallocBench/Interpreter.cpp:
643         (Interpreter::doMallocOp):
644         * MallocBench/MallocBench/Interpreter.h:
645         * MallocBench/MallocBench/fastMallocLog.63316.ops: Added.
646         * MallocBench/MallocBench/jetstream.cpp: Added.
647         (benchmark_jetstream):
648         * MallocBench/MallocBench/jetstream.h: Added.
649
650 2016-05-25  Keith Miller  <keith_miller@apple.com>
651
652         Unreviewed, add JSBench to the skipped list for now since it doesn't
653         work currently.
654
655         * Skipped:
656
657 2016-05-17  Keith Miller  <keith_miller@apple.com>
658         We should have JSBench in PerformanceTests
659         https://bugs.webkit.org/show_bug.cgi?id=157952
660
661         Rubber-stamped by Saam Barati.
662
663         There are some slight changes to the layout of the test directory
664         to make it work nicely with run-jsc-benchmarks. Before JSBench
665         had each of the browser specific sub-tests in a sub-directory.
666         These have been flattened e.g. amazon/safari/ has become
667         amazon-safari/.
668
669         * JSBench/amazon-chrome-win/urem.html: Added.
670         * JSBench/amazon-chrome-win/urem.js: Added.
671         * JSBench/amazon-chrome/urem.html: Added.
672         * JSBench/amazon-chrome/urem.js: Added.
673         * JSBench/amazon-firefox-win/urm.html: Added.
674         * JSBench/amazon-firefox-win/urm.js: Added.
675         * JSBench/amazon-firefox/urm.html: Added.
676         * JSBench/amazon-firefox/urm.js: Added.
677         * JSBench/amazon-safari/urem.html: Added.
678         * JSBench/amazon-safari/urem.js: Added.
679         * JSBench/browsercheck.js: Added.
680         * JSBench/facebook-chrome-win/urem.html: Added.
681         * JSBench/facebook-chrome-win/urem.js: Added.
682         * JSBench/facebook-chrome/urem.html: Added.
683         * JSBench/facebook-chrome/urem.js: Added.
684         * JSBench/facebook-firefox-win/urem.html: Added.
685         * JSBench/facebook-firefox-win/urem.js: Added.
686         * JSBench/facebook-firefox/urem.html: Added.
687         * JSBench/facebook-firefox/urem.js: Added.
688         * JSBench/facebook-safari/urem.html: Added.
689         * JSBench/facebook-safari/urem.js: Added.
690         * JSBench/google-chrome-win/urem.html: Added.
691         * JSBench/google-chrome-win/urem.js: Added.
692         * JSBench/google-chrome/urem.html: Added.
693         * JSBench/google-chrome/urem.js: Added.
694         * JSBench/google-firefox-win/urem.html: Added.
695         * JSBench/google-firefox-win/urem.js: Added.
696         * JSBench/google-firefox/uem.html: Added.
697         * JSBench/google-firefox/uem.js: Added.
698         * JSBench/google-safari/urem.html: Added.
699         * JSBench/google-safari/urem.js: Added.
700         * JSBench/harness.html: Added.
701         * JSBench/harness.js: Added.
702         * JSBench/harness.py: Added.
703         * JSBench/index.html: Added.
704         * JSBench/reload.html: Added.
705         * JSBench/twitter-chrome-win/rem.html: Added.
706         * JSBench/twitter-chrome-win/rem.js: Added.
707         * JSBench/twitter-chrome/urem.html: Added.
708         * JSBench/twitter-chrome/urem.js: Added.
709         * JSBench/twitter-firefox-win/urem.html: Added.
710         * JSBench/twitter-firefox-win/urem.js: Added.
711         * JSBench/twitter-firefox/urem.html: Added.
712         * JSBench/twitter-firefox/urem.js: Added.
713         * JSBench/twitter-safari/urem.html: Added.
714         * JSBench/twitter-safari/urem.js: Added.
715         * JSBench/yahoo-chrome-win/urem.html: Added.
716         * JSBench/yahoo-chrome-win/urem.js: Added.
717         * JSBench/yahoo-chrome/urem.html: Added.
718         * JSBench/yahoo-chrome/urem.js: Added.
719         * JSBench/yahoo-firefox-win/urem.html: Added.
720         * JSBench/yahoo-firefox-win/urem.js: Added.
721         * JSBench/yahoo-firefox/urem.html: Added.
722         * JSBench/yahoo-firefox/urem.js: Added.
723         * JSBench/yahoo-safari/urem.html: Added.
724         * JSBench/yahoo-safari/urem.js: Added.
725
726 2016-05-20  Ryosuke Niwa  <rniwa@webkit.org>
727
728         run-benchmark's results should contain Animometer's debug output
729         https://bugs.webkit.org/show_bug.cgi?id=157941
730
731         Reviewed by Stephanie Lewis.
732
733         Made developer.html support the JSON generated by run-benchmark which stores everything under debugOutput.
734
735         * Animometer/resources/debug-runner/animometer.js:
736         (Utilities.initialize): Unwrap debugOutput in the case run-benchmark's result JSON is used.
737
738 2016-05-18  Timothy Hatcher  <timothy@apple.com>
739
740         Make Animometer work in all browsers
741         https://bugs.webkit.org/show_bug.cgi?id=157855
742         rdar://problem/26338521
743
744         Reviewed by Jon Lee.
745
746         * Animometer/resources/runner/logo.svg: Use a symbol instead
747         of putting the id on the root svg. This works in all browsers.
748
749 2016-05-07  Timothy Hatcher  <timothy@apple.com>
750
751         Update Animometer design
752         https://bugs.webkit.org/show_bug.cgi?id=157449
753
754         Reviewed by Darin Adler.
755
756         * Animometer/developer.html: Stop including runner/animometer.css.
757         * Animometer/index.html: Udpated elements to fit new styles.
758
759         * Animometer/resources/debug-runner/animometer.css:
760         Copy the old runner/animometer.css to here so the debug runner is unaffected.
761
762         * Animometer/resources/runner/animometer.css:
763         New styles for the design. Drop flex box for broad browser support.
764
765         * Animometer/resources/runner/animometer.js:
766         (ResultsTable.clear): Use textContent.
767         (window.sectionsManager.showSection): Add class to the body.
768         (window.sectionsManager.setSectionScore): Use textContent, not innerHTML.
769
770         * Animometer/resources/runner/crystal.svg: Added.
771         * Animometer/resources/runner/lines.svg: Added.
772         * Animometer/resources/runner/logo.svg: Added.
773
774         * Animometer/resources/runner/tests.js: Shorten test name and title case them.
775
776 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
777
778         [css-grid] Unprefix CSS Grid Layout properties
779         https://bugs.webkit.org/show_bug.cgi?id=157137
780
781         Reviewed by Simon Fraser.
782
783         Remove "-webkit" prefix from all the grid layout properties,
784         including the display value.
785         Update the source code to remove the prefix where it was used too.
786
787         * Layout/auto-grid-lots-of-data.html:
788         * Layout/fixed-grid-lots-of-data.html:
789         * Layout/fixed-grid-lots-of-stretched-data.html:
790
791 2016-04-25  Geoffrey Garen  <ggaren@apple.com>
792
793         bmalloc: Misc improvements to MallocBench
794         https://bugs.webkit.org/show_bug.cgi?id=157004
795
796         Reviewed by Darin Adler.
797
798         * MallocBench/run-malloc-benchmarks: Added --memory and --memory_warning
799         modes for focused memory testing.
800
801         * MallocBench/MallocBench/Benchmark.cpp:
802         (Benchmark::printReport): Clarified output.
803
804         (Benchmark::currentMemoryBytes): Added compressed memory because top
805         does the same. (It always happens to zero in the benchmarks we run. But
806         this is good for sanity.)
807
808         * MallocBench/MallocBench/CommandLine.cpp: Moved up to 8 runs to reduce
809         variance.
810
811         * MallocBench/MallocBench/alloc_free.cpp:
812         (benchmark_alloc_free): Cycle a single allocation in order to stress
813         the effect of merging on calls to madvise.
814
815         * MallocBench/MallocBench/big.cpp:
816         (benchmark_big): Graduated to 8kB-128kB because medium tests up to 8 and
817         our large allocator doesn't kick in until 64kB.
818
819         * MallocBench/MallocBench/medium.cpp:
820         (benchmark_medium): Test all the way down to 1kB because our large
821         allocator used to service 1kB allocations and 1kB is an interesting
822         middle size where memory is unusually large but allocation throughput
823         still matters.
824
825         * MallocBench/MallocBench/stress.cpp:
826         (benchmark_stress): Reduced the churn count to match stress_aligned
827         because this test was taking too long to complete.
828
829         * MallocBench/MallocBench/stress_aligned.cpp:
830         (benchmark_stress_aligned): Our new large allocator can handle even
831         more absurdly large values.
832
833 2016-04-25  Simon Fraser  <simon.fraser@apple.com>
834
835         Add a content animation test that uses SVG animation.
836         https://bugs.webkit.org/show_bug.cgi?id=156827
837
838         * Animation/svg-animation.html: Added.
839         * Skipped:
840
841 2016-04-22  Simon Fraser  <simon.fraser@apple.com>
842
843         Skip two content animation tests which are only meant for iOS testing.
844
845         * Animation/css-animation.html: Added.
846         * Animation/raf-animation.html: Added.
847
848         * Skipped:
849
850 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
851
852         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
853         https://bugs.webkit.org/show_bug.cgi?id=156827
854
855         Add two files missing from the previous commit.
856
857         * Animation/css-animation.html: Added.
858         * Animation/raf-animation.html: Added.
859
860 2016-04-20  Simon Fraser  <simon.fraser@apple.com>
861
862         Add content animation tests to benchmark_runner, and allow the runner to collect device data as part of the results
863         https://bugs.webkit.org/show_bug.cgi?id=156827
864
865         Reviewed by Stephanie Lewis.
866
867         Two new files for the content-animation suite.
868
869         After patching for use in the benchmark, these tests are a little different to other benchmarks.
870         The test content itself does not collect performance data; the tests spit out a boilerplate JSON
871         result with a placeholder for framerate, which is collected in native code.
872
873         When run as a benchmark, test completion involves a couple of bounces between the test and MobileSafari.
874         Test completion is initiated by a setTimeout() in the test, at which point location.hash is set to "#done".
875         MobileSafari detects that, and asynchronously dumps performance data. Once this is complete, MobileSafari
876         changes the URL has to "#submit", which triggers the XHR to the test relay that indicates the test is
877         complete.
878
879         * Animation/css-animation.html: Added.
880         * Animation/raf-animation.html: Added.
881
882 2016-04-15  Jon Lee  <jonlee@apple.com>
883
884         Animometer test could report a NaN
885         https://bugs.webkit.org/show_bug.cgi?id=156646
886
887         Reviewed by Darin Adler.
888         Provisionally reviewed by Said Abou-Hallawa.
889
890         * Animometer/tests/resources/main.js:
891         (didFinishInterval): The ramp controller has a first phase where it ramps up the complexity and
892         reacts based on how well the system handles the load. The assumption was that it would handle at least
893         1 particle easily. That is not always the case. As a result, an interpolation calculation could
894         end up setting an upper bound of NaN.
895
896         This occurs because we never get out of the first tier, so this._lastTierComplexity is undefined.
897         Now that we guarantee a minimum complexity of 1, modify the conditional to check for this._lastTierComplexity
898         before interpolating the upper bound of the first ramp. In the case where the system struggles with
899         1 particle, set it to currentComplexity.
900
901 2016-04-09  Jon Lee  <jonlee@apple.com>
902
903         Update Animometer to accommodate different screens
904         https://bugs.webkit.org/show_bug.cgi?id=156449
905
906         Reviewed by Darin Adler.
907         Provisionally reviewed by Said Abou-Hallawa.
908
909         * Animometer/index.html: Wrap button in a container to add padding at the bottom.
910         * Animometer/resources/debug-runner/animometer.css:
911         (@media screen and (min-device-width: 1800px)): Deleted.
912         (@media screen and (min-width: 1800px)): Cannot use min-device-width since it may match incorrectly.
913         (screen and (max-device-height: 414px) and (orientation: landscape)): Some devices swap device width
914         and height with orientation change.
915         * Animometer/resources/runner/animometer.css: Similar.
916         (screen and (min-device-width: 1024px) and (orientation: landscape)):
917         (screen and (max-device-height: 414px) and (orientation: landscape)):
918         (.frame-container): On smaller iPhones, adding 1px prevents the navigation bars from appearing.
919         (@media screen and (min-device-width: 768px) and (max-device-width: 1024px)): Deleted.
920         (@media (min-device-height: 768px) and (max-device-height: 1024px)): Target iPad Airs and similar.
921         (@media screen and (min-device-width: 1024px) and (max-device-width: 1366px)): Deleted.
922         (@media screen and (max-device-width: 1024px) and (min-device-height: 1366px)): Target iPad Pro.
923         (#results footer): Add padding below the button for testing again.
924         * Animometer/tests/master/multiply.html: Remove the center text.
925         * Animometer/tests/master/resources/text.js: Update the test so that in every frame the text moves.
926         * Animometer/tests/master/text.html: Update the text sizing depending on the size of the device.
927
928 2016-04-08  Jon Lee  <jonlee@apple.com>
929
930         Have Animometer benchmark always start with complexity of 1
931         https://bugs.webkit.org/show_bug.cgi?id=156432
932
933         Reviewed by Ryosuke Niwa.
934
935         * Animometer/tests/resources/main.js: Update the default Controller and RampController to
936         set its minimum complexities to 1 instead of 0.
937
938 2016-04-08  Jon Lee  <jonlee@apple.com>
939
940         Fix SVG benchmark test
941         https://bugs.webkit.org/show_bug.cgi?id=156410
942
943         Reviewed by Dean Jackson.
944
945         * Animometer/resources/extensions.js: Update Point.zero to be a static Point.
946         * Animometer/tests/simple/resources/tiled-canvas-image.js:
947         (Stage.call._setupTiles): Refactor.
948         * Animometer/tests/master/resources/particles.js:
949         (Particle.prototype.reset): Use Point.center.
950         (complexity): We are not using a gradient background anymore, so remove the +1.
951         * Animometer/tests/master/resources/svg-particles.js: Update to use SVG transform
952         instead of CSS transform.
953
954 2016-04-06  Jon Lee  <jonlee@apple.com>
955
956         Update master benchmark with SVG test
957         https://bugs.webkit.org/show_bug.cgi?id=156273
958
959         Reviewed by Dean Jackson.
960         Provisionally reviewed by Said Abou-Hallawa.
961
962         Switch masks tests for SVG path test.
963
964         * Animometer/resources/debug-runner/tests.js: Move mask test here.
965         * Animometer/resources/runner/tests.js: Add SVG test here.
966         * Animometer/tests/dom/particles.html: Renamed from PerformanceTests/Animometer/tests/master/particles.html.
967         * Animometer/tests/dom/resources/dom-particles.js: Renamed from PerformanceTests/Animometer/tests/master/resources/dom-particles.js.
968
969         * Animometer/tests/master/resources/particles.js: Add minPosition for bounds checking. Prevents particle from being
970         partially obscured.
971         * Animometer/tests/master/resources/svg-particles.js: Added.
972         (Particle): The particle is either a path object or a rect using a path as a clip. The
973         same path is used either way. For each particle create a linear gradient with a random
974         rotation.
975         (SVGParticlesStage): Look in #shapes to see how many different kinds of paths are available.
976         This makes the test more generic in case other shapes need to be tested.
977         * Animometer/tests/master/svg-particles.html: Added. Have two defs, one that houses each
978         particle's gradient, and one that holds the shape templates.
979
980 2016-03-27  Hunseop Jeong  <hs85.jeong@samsung.com>
981
982         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
983         https://bugs.webkit.org/show_bug.cgi?id=148470 
984
985         Reviewed by Darin Adler.
986
987         * Skipped: Unskip the Bindings/event-target-wrapper test.
988
989 2016-03-23  Jon Lee  <jonlee@apple.com>
990
991         Update focus and leaves tests
992         https://bugs.webkit.org/show_bug.cgi?id=155825
993
994         Reviewed by Simon Fraser.
995
996         Particles would improperly disappear, before they were fully off stage. Update the calculation.
997         * Animometer/tests/dom/resources/leaves.js:
998         * Animometer/tests/master/resources/leaves.js:
999
1000         * Animometer/tests/master/focus.html: Update the center element styling.
1001         * Animometer/tests/master/resources/focus.js:
1002         (FocusElement.Utilities.createClass): Give enough space in the container for each particle for the blur
1003         to spread. It should be about 3x more space than the blur radius on each side.
1004         (Stage.call.initialize): Ditto for the center element.
1005
1006 2016-03-23  Jon Lee  <jonlee@apple.com>
1007
1008         Update support for other platforms
1009         https://bugs.webkit.org/show_bug.cgi?id=155824
1010
1011         Reviewed by Simon Fraser.
1012
1013         * Animometer/resources/debug-runner/animometer.css: Remove extraneous media query. All of it should
1014         be handled in the release stylesheet.
1015         * Animometer/resources/debug-runner/animometer.js: Add support for browsers that return an HTMLCollection
1016         when retrieving radio elements with a name, instead of the selected value.
1017         * Animometer/resources/runner/animometer.css: Adjust the queries for devices of varying widths.
1018         (.frame-container): Move overflow:hidden to #stage.
1019         * Animometer/tests/master/resources/stage.css: Consolidate into tests/resources/stage.css.
1020         * Animometer/tests/resources/stage.css:
1021         (body): Remove overflow:hidden.
1022         (#stage): Set overflow:hidden here.
1023         (#center-text): Moved from master/resources/stage.css.
1024
1025         Update stylesheet hrefs.
1026         * Animometer/tests/master/canvas-stage.html:
1027         * Animometer/tests/master/focus.html:
1028         * Animometer/tests/master/leaves.html:
1029         * Animometer/tests/master/multiply.html:
1030         * Animometer/tests/master/particles.html:
1031         * Animometer/tests/master/text.html: Adjust text size to fit in the device screen.
1032
1033 2016-03-23  Jon Lee  <jonlee@apple.com>
1034
1035         Make the benchmark require device to be in landscape orientation
1036         https://bugs.webkit.org/show_bug.cgi?id=155822
1037         rdar://problem/25258650
1038
1039         Reviewed by Ryosuke Niwa.
1040
1041         Check that the device is in landscape orientation. If not, disable the button to start it,
1042         and show a warning message.
1043
1044         * Animometer/developer.html: Add a message about how the browser should be set up. Include a
1045         warning message that appears if the orientation is incorrect on mobile devices.
1046         * Animometer/index.html: Ditto.
1047
1048         * Animometer/resources/debug-runner/animometer.css: Migrate the .hidden rule into the release
1049         stylesheet. Update the style to accommodate the new UI.
1050         * Animometer/resources/runner/animometer.css:
1051
1052         * Animometer/resources/runner/animometer.js:
1053         (window.benchmarkController.initialize): Add the orientation listener is needed.
1054         (window.benchmarkController.addOrientationListenerIfNecessary): Only mobile devices need this. Check
1055         to see for support of window.orientation.
1056         (window.benchmarkController._orientationChanged): Toggle the warning based on whether we match the
1057         landscape query. Set a state variable, which is needed for the debug harness. Call updateStartButtonState.
1058         (window.benchmarkController.updateStartButtonState):
1059         * Animometer/resources/debug-runner/animometer.js: Change _updateStartButtonState to return
1060         a boolean about whether at least one test is selected. That will be used in
1061         benchmarkController.updateStartButtonState(). Move the load event listener to the release version.
1062         (window.benchmarkController.updateStartButtonState): Override the release version, and also check
1063         that at least one test is selected.
1064
1065 2016-03-22  Geoffrey Garen  <ggaren@apple.com>
1066
1067         MallocBench: consolidate regression testing for aligned allocation
1068         https://bugs.webkit.org/show_bug.cgi?id=155762
1069
1070         Reviewed by Michael Saboff.
1071
1072         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
1073         * MallocBench/MallocBench/Benchmark.cpp:
1074         * MallocBench/MallocBench/memalign.cpp: Removed.
1075         * MallocBench/MallocBench/memalign.h: Removed. The stress_aligned test
1076         covers this and much more.
1077
1078         * MallocBench/MallocBench/stress_aligned.cpp:
1079         (benchmark_stress_aligned): Include specific tests for extreme sizes
1080         and alignments.
1081
1082 2016-03-21  Jon Lee  <jonlee@apple.com>
1083
1084         Update benchmark tests
1085         https://bugs.webkit.org/show_bug.cgi?id=155723
1086
1087         Reviewed by Darin Adler.
1088         Provisionally reviewed by Said Abou-Hallawa.
1089
1090         Add quadratic and bezier segments to the canvas path test.
1091
1092         * Animometer/resources/runner/tests.js: Some of the query strings are unnecessary.
1093         Rename the test.
1094         * Animometer/tests/master/resources/canvas-stage.js:
1095         (tune): Update to be able to take an array of possible constructors. Choose one randomly.
1096         * Animometer/tests/master/resources/canvas-tests.js:
1097         (CanvasLinePoint.Utilities.createClass): Move the point selection out to a separate
1098         function called randomPoint() for reuse. Move X_LOOPS, Y_LOOPS, and offsets into the
1099         class definition.
1100         (randomPoint): Scale the grid down a little bit so that the lines along the edge of the
1101         canvas are not cut off when the stroke size is thick.
1102         (CanvasQuadraticSegment): Added.
1103         (CanvasBezierSegment): Added.
1104         (SimpleCanvasStage): Pass in an array of the different segment types. Since line segments
1105         are short compared to the curved ones, make it twice as likely to render a line segment.
1106         (SimpleCanvasStage.animate): Update the drawing code so that we render all line segments.
1107
1108         Add a helper method that selects a random element from an array.
1109
1110         * Animometer/tests/resources/main.js:
1111         (Stage.randomElementInArray): Select a random element from the provided array.
1112
1113         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Refactor.
1114         * Animometer/tests/dom/resources/leaves.js: Ditto.
1115         * Animometer/tests/master/resources/dom-particles.js: Ditto.
1116         * Animometer/tests/master/resources/image-data.js: Ditto.
1117         * Animometer/tests/master/resources/leaves.js: Ditto.
1118         * Animometer/tests/simple/resources/simple-canvas-paths.js: Ditto.
1119
1120         Add canvas tests that includes all stroke and fill paths. This makes it possible to avoid having to
1121         include the full simple canvas suite for perf testing.
1122
1123         * Animometer/resources/debug-runner/tests.js: Add new tests. Move the canvas test into the Canvas
1124         suite.
1125         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add a CanvasStroke and CanvasFill particle
1126         that random selects an object to render.
1127
1128         * Animometer/resources/debug-runner/tests.js: Move 3D suite before basic canvas suite.
1129         When updating the perf bot script, we will include the suites up to this one, but exclude
1130         the basic canvas suite.
1131
1132         Move compositing transforms test to HTML suite and remove the empty Miscellaneous suite.
1133
1134         * Animometer/resources/debug-runner/tests.js:
1135         * Animometer/tests/dom/compositing-transforms.html: Renamed from PerformanceTests/Animometer/tests/misc/compositing-transforms.html.
1136         * Animometer/tests/dom/resources/compositing-transforms.js: Renamed from PerformanceTests/Animometer/tests/misc/resources/compositing-transforms.js.
1137
1138         Clean up miscellaneous test suite. Add a canvas ellipse test, and remove the other
1139         canvas tests.
1140
1141         * Animometer/resources/debug-runner/tests.js: Add ellipse tests to the simple suite.
1142         * Animometer/tests/misc/canvas-electrons.html: Removed.
1143         * Animometer/tests/misc/canvas-stars.html: Removed.
1144         * Animometer/tests/misc/resources/canvas-electrons.js: Removed.
1145         * Animometer/tests/misc/resources/canvas-stars.js: Removed.
1146         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add ellipse primitives.
1147
1148         Merge text tests together into one.
1149
1150         * Animometer/resources/runner/tests.js: Remove international.html.
1151         * Animometer/tests/master/international.html: Removed.
1152         * Animometer/tests/master/resources/text.js:
1153         (animate): Update styling. Manually calculate gradients for the shadow particles.
1154         Reduce the step size for y direction to avoid cutting text off at the margins. Increase
1155         step for x since there will be a little more room.
1156         * Animometer/tests/master/text.html: Add more translations and lay it out in a table.
1157
1158 2016-03-20  Jon Lee  <jonlee@apple.com>
1159
1160         Add a link to show debug data
1161         https://bugs.webkit.org/show_bug.cgi?id=155724
1162
1163         Reviewed by Simon Fraser.
1164
1165         * Animometer/developer.html: Attach the onclick handler to the score.
1166         * Animometer/index.html: Ditto.
1167
1168 2016-03-18  Dean Jackson  <dino@apple.com>
1169
1170         Add a basic WebGL test to Animometer
1171         https://bugs.webkit.org/show_bug.cgi?id=155475
1172         <rdar://problem/25156860>
1173
1174         Reviewed by Simon Fraser and Jon Lee.
1175
1176         Add a pretty simple WebGL test to Animometer
1177         which tries to draw a number of animated triangles.
1178         The result still needs a bit of tuning.
1179
1180         * Animometer/resources/debug-runner/tests.js: Add a new
1181         Suite for "3D" tests.
1182         * Animometer/tests/3d/resources/webgl.js: Added.
1183         * Animometer/tests/3d/webgl.html: Added.
1184
1185 2016-03-18  Jon Lee  <jonlee@apple.com>
1186
1187         Add support for statically linking to a specific test
1188         https://bugs.webkit.org/show_bug.cgi?id=155631
1189
1190         Rubber-stamped by Darin Adler.
1191
1192         * Animometer/developer.html: Update to call restartBenchmark instead so that it works for
1193         both the preset and the manually set test sessions.
1194         * Animometer/resources/debug-runner/animometer.css:
1195         (.tree .link): Style the "link" UI.
1196         * Animometer/resources/debug-runner/animometer.js: Move updateDisplay from suitesManager
1197         to optionsManager since this is a visual option and has nothing to do with the suites
1198         settings. Update the construction of the test UI by including a "link" after each test.
1199         Clicking on that link brings up a JS prompt with a URL and a query string with the current
1200         parameters of the controller, and selected test. Pasting this URL into the location bar will
1201         automatically start running the selected test.
1202         (suitesManager.suitesFromQueryString): Iterate through the Suites and tests and find the one
1203         that matches the provided parameters. Returns an object similar to the form in
1204         suitesManager.updateLocalStorageFromUI.
1205         (benchmarkController.initialize): After settings up the events and options, try parsing the
1206         query string and running the benchmark immediately. Otherwise, fall back to the form.
1207         (benchmarkController.startBenchmark): Store the options and suites into member variables for
1208         reuse in restartBenchmark.
1209         (benchmarkController.startBenchmarkImmediatelyIfEncoded): Convert the query string to an object.
1210         If that's successful, find the suite and test referenced in the query string. Start the benchmark if
1211         the search for the test succeeded.
1212         * Animometer/resources/extensions.js:
1213         (Utilities.stripNonASCIICharacters): Helper method to convert the name of the suite and test
1214         into a query-string-friendly version.
1215         (Utilities.convertObjectToQueryString): Helper method to convert an object to query string
1216         format.
1217         (Utilities.convertQueryStringToObject): Helper method to convert query string into an object
1218         with properties and values.
1219
1220 2016-03-16  Jon Lee  <jonlee@apple.com>
1221
1222         Add a new benchmark test
1223         https://bugs.webkit.org/show_bug.cgi?id=155570
1224
1225         Reviewed by Simon Fraser.
1226
1227         New Leaves test includes various image sizes and opacity.
1228
1229         * Animometer/resources/debug-runner/tests.js: Add it to the HTML test suite.
1230         * Animometer/tests/dom/leaves.html: Added.
1231         * Animometer/tests/dom/resources/leaves.js: Added. Override the
1232         (Particle.call.reset): Uses a range of sizes, and opacity.
1233         (Particle.call.animate): Opacity goes up then down. When it hits 0, reset the particle.
1234         (Particle.call.move): Set transform and opacity.
1235         * Animometer/tests/master/resources/leaves.js: Get rid of the closure so that it
1236         can be used in this test. Update the relative path so that it works in both the master
1237         and dom test suite.
1238
1239 2016-03-15  Simon Fraser  <simon.fraser@apple.com>
1240
1241         Add developer Animometer test that bounces P3-tagged images
1242         https://bugs.webkit.org/show_bug.cgi?id=155511
1243
1244         Reviewed by Tim Horton.
1245         
1246         Add a test for rendering performance of tagged images. The 5 images are tagged
1247         with the Display P3 colorspace.
1248
1249         * Animometer/resources/debug-runner/tests.js:
1250         * Animometer/tests/bouncing-particles/bouncing-tagged-images.html: Added.
1251         * Animometer/tests/bouncing-particles/resources/bouncing-tagged-images.js: Added.
1252         * Animometer/tests/bouncing-particles/resources/image1.jpg: Added.
1253         * Animometer/tests/bouncing-particles/resources/image2.jpg: Added.
1254         * Animometer/tests/bouncing-particles/resources/image3.jpg: Added.
1255         * Animometer/tests/bouncing-particles/resources/image4.jpg: Added.
1256         * Animometer/tests/bouncing-particles/resources/image5.jpg: Added.
1257
1258 2016-03-09  Jon Lee  <jonlee@apple.com>
1259
1260         Enhance existing Animometer tests
1261         https://bugs.webkit.org/show_bug.cgi?id=155261
1262
1263         Reviewed by Simon Fraser.
1264
1265         * Animometer/tests/master/resources/canvas-tests.js: Add a gradient to
1266         the filled circles. To expose more of the gradient, add another circle.
1267         (SimpleCanvasStage.call.animate): For each frame, create a gradient with
1268         undulating stop points and colors. Fill the circles twice; once with
1269         the solid color, and once with the gradient.
1270
1271         * Animometer/tests/master/resources/dom-particles.js: Refactor the
1272         emission variables into a separate stage for this test. Add a colorOffset
1273         variable to make the colors of each particle slightly different, since
1274         the ramp controller can add large numbers of particles all at once, which
1275         would otherwise get all the same color.
1276         * Animometer/tests/master/resources/particles.js:
1277         (initialize): Remove the code specific to the SVG mask test.
1278
1279         * Animometer/tests/master/resources/image-data.js:
1280         (initialize): Remove unused local variable.
1281         * Animometer/tests/master/resources/multiply.js:
1282         (initialize): Make the test harder by adding more total particles.
1283
1284 2016-03-09  Jon Lee  <jonlee@apple.com>
1285
1286         Add text tests
1287         https://bugs.webkit.org/show_bug.cgi?id=155257
1288
1289         Reviewed by Simon Fraser.
1290
1291         * Animometer/resources/extensions.js:
1292         (UnitBezier.Utilities.createClass): Add a class that computes Bezier points
1293         assuming that two of the control points are at (0,0) and (1,1). Taken from
1294         WebCore/platform/graphics/UnitBezier.h
1295         * Animometer/resources/runner/tests.js: Add a test for English text and one
1296         for international text.
1297         * Animometer/tests/master/international.html: Added.
1298         * Animometer/tests/master/resources/text.js: Added. The test assumes there is
1299         #template div which it will copy. The copies are placed behind the template, and
1300         are set with different colors each frame. They are moved around with CSS transform.
1301         * Animometer/tests/master/text.html: Added.
1302
1303         Remove the other text tests, since these ones cover the same techniques.
1304         * Animometer/tests/text/layering-text.html: Removed.
1305         * Animometer/tests/text/resources/layering-text.js: Removed.
1306         * Animometer/tests/text/resources/text-boxes.js: Removed.
1307         * Animometer/tests/text/text-boxes.html: Removed.
1308         * Animometer/resources/debug-runner/tests.js:
1309
1310 2016-03-09  Jon Lee  <jonlee@apple.com>
1311
1312         Add a new image test
1313         https://bugs.webkit.org/show_bug.cgi?id=155232
1314
1315         Reviewed by Dean Jackson.
1316         Provisionally reviewed by Said Abou-Hallawa.
1317
1318         The image test renders PNGs and moves them with translate and rotate
1319         transforms. Each particle has a lifetime, and when the lifetime ends or
1320         the particle goes offscreen, it resets itself somewhere on the stage.
1321
1322         * Animometer/resources/debug-runner/tests.js: Remove the CSS bouncing PNG
1323         images test, because this one tests the same technique.
1324         * Animometer/resources/runner/tests.js: Added here as "Leaves".
1325         * Animometer/tests/master/leaves.html: Added.
1326         * Animometer/tests/master/resources/particles.js: Refactor out the parts
1327         specific to the DOM particles test. Consequently make velocity a public
1328         member.
1329         (initialize): The options parameter is never used, so remove it.
1330         (animate): Remove unused local variable.
1331         * Animometer/tests/master/resources/leaves.js: Maintains a focal point that
1332         moves back and forth across the canvas. That point affects the velocity
1333         of the particles. When the focal point is on the leftmost side, it is
1334         between [-6, -2], and set in reset(). When the focal point is on the rightmost
1335         side, it will be from [2, 6].
1336         * Animometer/tests/master/resources/dom-particles.js: Move JS specific to
1337         this test here from particles.js.
1338
1339         New images.
1340         * Animometer/tests/master/resources/compass100.png: Added.
1341         * Animometer/tests/master/resources/console100.png: Added.
1342         * Animometer/tests/master/resources/contribute100.png: Added.
1343         * Animometer/tests/master/resources/debugger100.png: Added.
1344         * Animometer/tests/master/resources/inspector100.png: Added.
1345         * Animometer/tests/master/resources/layout100.png: Added.
1346         * Animometer/tests/master/resources/performance100.png: Added.
1347         * Animometer/tests/master/resources/script100.png: Added.
1348         * Animometer/tests/master/resources/shortcuts100.png: Added.
1349         * Animometer/tests/master/resources/standards100.png: Added.
1350         * Animometer/tests/master/resources/storage100.png: Added.
1351         * Animometer/tests/master/resources/styles100.png: Added.
1352         * Animometer/tests/master/resources/timeline100.png: Added.
1353
1354 2016-03-03  Jon Lee  <jonlee@apple.com>
1355
1356         Add ability to retrieve raw data from release harness
1357         https://bugs.webkit.org/show_bug.cgi?id=155026
1358
1359         Reviewed by Simon Fraser.
1360
1361         * Animometer/developer.html: Remove the special UI in the debug
1362         harness.
1363         * Animometer/resources/runner/animometer.css: Add styles for the
1364         overlay.
1365         * Animometer/resources/runner/animometer.js: Let 'j' show the JSON
1366         results, but only if the overlay doesn't exist. Add 'esc' key to dismiss
1367         the overlay.
1368         (window.benchmarkController.selectResults): Cycle the cases around
1369         so that the first 's' press selects both the benchmark score and
1370         the individual test scores.
1371         * Animometer/resources/debug-runner/animometer.css: Remove
1372         unneeded rules.
1373         * Animometer/resources/debug-runner/animometer.js: Make the same
1374         call to handleKeyPress.
1375
1376 2016-03-03  Jon Lee  <jonlee@apple.com>
1377
1378         Make sure multiply test particles have at least some opacity
1379         https://bugs.webkit.org/show_bug.cgi?id=155027
1380
1381         Reviewed by Simon Fraser.
1382
1383         * Animometer/tests/master/resources/multiply.js:
1384         (initialize): Have the elements spin a little faster to make it
1385         more obvious when the system is being stressed.
1386         (_addTile):
1387         (animate): Make sure each element being animated has at least 1%
1388         opacity.
1389
1390 2016-03-03  Jon Lee  <jonlee@apple.com>
1391
1392         Update image test
1393         https://bugs.webkit.org/show_bug.cgi?id=154962
1394
1395         Rubber-stamped by Darin Adler.
1396
1397         * Animometer/tests/master/image-data.html: Make each canvas have a compositing layer.
1398         * Animometer/tests/master/resources/image-data.js:
1399         (initialize): Update to load multiple images serially.
1400         (_loadImage):
1401         (tune): Use display instead of visibility. When showing an element anew, move it somewhere else.
1402         (_createTestElement): Set up the element, refactor out placement of element to _refreshElement.
1403         (_refreshElement): Place element in a tile grid.
1404         (animate):
1405         (_getRandomNeighboringPixelIndex): Use a more conservative distribution to make the effect last a little longer.
1406         * Animometer/tests/master/resources/compass.svg: Added.
1407         * Animometer/tests/master/resources/console.svg: Added.
1408         * Animometer/tests/master/resources/contribute.svg: Added.
1409         * Animometer/tests/master/resources/debugger.svg: Added.
1410         * Animometer/tests/master/resources/inspector.svg: Added.
1411         * Animometer/tests/master/resources/layout.svg: Added.
1412         * Animometer/tests/master/resources/performance.svg: Added.
1413         * Animometer/tests/master/resources/script.svg: Added.
1414         * Animometer/tests/master/resources/shortcuts.svg: Added.
1415         * Animometer/tests/master/resources/standards.svg: Added.
1416         * Animometer/tests/master/resources/storage.svg: Added.
1417         * Animometer/tests/master/resources/styles.svg: Added.
1418         * Animometer/tests/master/resources/timeline.svg: Added.
1419
1420 2016-03-02  Jon Lee  <jonlee@apple.com>
1421
1422         Add some new controllers, and refine tests
1423         https://bugs.webkit.org/show_bug.cgi?id=154914
1424
1425         Reviewed by Simon Fraser.
1426
1427         Improve tests.
1428
1429         * Animometer/tests/master/focus.html: Move each particle into a layer. Put the particle
1430         in a container element. Expand the container element by the max blur radius, and clip
1431         overflow. This way, when the blur is applied, it avoids causing layer resizes.
1432         * Animometer/tests/master/resources/focus.js:
1433         (FocusElement.Utilities.createClass): Create a container element, and put the particle
1434         inside.
1435         (hide): Set display:none.
1436         (show): Set display:block.
1437         (animate): Apply filters to the container element.
1438         (FocusStage.call.initialize): Instead of inserting and removing elements from the DOM,
1439         keep them in the stage, but set the display style instead. Use this._offsetIndex to
1440         keep track of which elements are displayed.
1441         (FocusStage.call.animate): Move some calculations around to avoid doing unneeded math.
1442         (FocusStage.call.getBlurValue): Make sure elements are always blurred.
1443         (FocusStage.call.getOpacityValue): Make sure elements have some opacity.
1444         * Animometer/tests/master/resources/multiply.js: Have the particles on the edge of the
1445         stage appear less black when the complexity gets large enough.
1446         (tune): Have this._distanceFactor calculate the factor. Avoid calculating square root each
1447         frame.
1448
1449 2016-03-02  Jon Lee  <jonlee@apple.com>
1450
1451         Add some new controllers, and refine tests
1452         https://bugs.webkit.org/show_bug.cgi?id=154914
1453
1454         Reviewed by Simon Fraser.
1455
1456         Add a controller that centers around 30 fps instead of 60 fps.
1457
1458         * Animometer/developer.html: Add a new option.
1459         * Animometer/resources/debug-runner/animometer.js:
1460         * Animometer/resources/runner/animometer.js:
1461         (this._processData.findRegression): When calculating the complexity-frameLength regression,
1462         check the controller, and use a 30 fps baseline if needed.
1463         * Animometer/resources/statistics.js:
1464         (Regression.Utilities.createClass): Update to allow clients to specify the baseline
1465         frame length.
1466         * Animometer/tests/resources/main.js:
1467         (tune): Override some of the constants in RampController. Move those constants out for
1468         easier reading.
1469
1470         Add a fixed controller, with no step.
1471
1472         * Animometer/developer.html: Add a controller that takes no step.
1473         * Animometer/resources/debug-runner/animometer.js:
1474         * Animometer/tests/resources/main.js:
1475         (Rotater.Utilities.createClass):
1476
1477         Switch to ramp controller as default.
1478
1479         * Animometer/developer.html: Increase the test length to 20 seconds.
1480         * Animometer/resources/debug-runner/animometer.js: Rename the "adjustment" field to "controller"
1481         since that is a more accurate description.
1482         * Animometer/resources/debug-runner/graph.js:
1483         * Animometer/resources/runner/animometer.js: Update preferences for release suite.
1484
1485 2016-02-26  Jon Lee  <jonlee@apple.com>
1486
1487         Address Dean's comments in 154673.
1488
1489         * Animometer/developer.html:
1490         * Animometer/resources/debug-runner/animometer.js:
1491         * Animometer/resources/debug-runner/graph.js:
1492
1493 2016-02-25  Jon Lee  <jonlee@apple.com>
1494
1495         Update animation benchmark and tests
1496         https://bugs.webkit.org/show_bug.cgi?id=154673
1497
1498         Reviewed by Dean Jackson.
1499
1500         Update test visuals.
1501
1502         * Animometer/tests/master/resources/canvas-tests.js:
1503         (CanvasLineSegment.Utilities.createClass): Line segments near the edge of the stage get clipped.
1504         Update circle position and radius to minimize impact.
1505         * Animometer/tests/master/resources/particles.js: Get rid of rotating gradient background, and
1506         have 3 locations for emitting particles.
1507         * Animometer/tests/master/resources/multiply.js: Update distance metric so that fringe tiles get
1508         more color.
1509         (initialize): Fix some of the math for laying out the tiles.
1510         (animate): When a tile isn't used, set visibility: hidden.
1511
1512 2016-02-24  Jon Lee  <jonlee@apple.com>
1513
1514         Update animation benchmark and tests
1515         https://bugs.webkit.org/show_bug.cgi?id=154673
1516
1517         Reviewed by Dean Jackson.
1518
1519         Update the ramp controller.
1520
1521         The controller refines the complexity interval to test across.
1522
1523         * Animometer/resources/statistics.js: Add functions that estimate cumulative distribution function.
1524         (Regression): For the flat regression, force the first segment to be at 60 fps.
1525         (valueAt): Add convenience function to return interpolated value based on the regression used.
1526         (_calculateRegression): Include the number of points included for both segments, and the piecewise
1527         errors.
1528         * Animometer/tests/resources/math.js: Make the Kalman estimator subclass Experiment, and allow it
1529         to be reset.
1530
1531         * Animometer/tests/resources/main.js: Initialize the tier such that it starts at 10^0 = 1.
1532         Increase the number of ramps. Maintain three FPS thresholds-- the frame rate of interest, a limit
1533         on the lowest FPS we care to go for later interpolation, and a minimum FPS threshold we want to
1534         aim for each ramp. Also keep three estimators: a running average of the change point, a minimum
1535         boundary for each ramp, and an estimator for all the frames within an interval. The first two
1536         are used to determine the parameters of the next ramp, and the latter allows us to refine the
1537         parameters.
1538         (update): During the tier phase, it is possible that the highest complexity possible for a test
1539         won't stress the system enough to trigger stopping the tier phase and transitioning to the ramps.
1540         If the complexity doesn't change when going to the next tier, we've maxed the test out, and move
1541         on. When the tier phase completed, turn off Controller.frameLengthEstimator, which estimates the
1542         FPS at each tier.
1543         (tune): At each interval, look at the confidence distribution of being on the 60 FPS side or the
1544         slow side. If the slowest FPS we achieve at the ramp's maximum complexity is not at least
1545         _fpsRampSlowThreshold, then increase the maximum complexity. If we ever achieve 60 FPS, increase
1546         the ramp's minimum complexity to that level. If, at an even lower complexity, a glitch causes the
1547         FPS to drop, we reset the minimum complexity.
1548
1549         Have the bootstrap calculation occur between tests. Clean up harness.
1550
1551         * Animometer/resources/debug-runner/animometer.js: Run bootstrap after a test has
1552         completed to avoid doing all of it at the end before showing the results. Clean up
1553         parameters being passed around.
1554         * Animometer/resources/debug-runner/tests.js:
1555         (text):
1556         * Animometer/resources/runner/animometer.js:
1557         (this._processData.calculateScore): Save the results to the same object holding the data.
1558         (this._processData._processData): In the case where a file is dragged, calculate the score
1559         serially. Grab the results object and move it to the results variable and remove it from
1560         the data object. This avoids serializing the results into the JSON.
1561         (this._processData.findRegression): Include the samples used for bootstrapping. Reduce the
1562         resample size to shorten the wait.
1563         * Animometer/resources/runner/benchmark-runner.js:
1564         * Animometer/resources/statistics.js:
1565         (bootstrap): Update how bootstrapData is sorted. In some regression results the mix of
1566         floats and integers causes an alphabetical sort to occur.
1567         * Animometer/resources/strings.js:
1568
1569         Add meta charset so that encodings between harness and test match.
1570
1571         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1572         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1573         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1574         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1575         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1576         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1577         * Animometer/tests/master/canvas-stage.html:
1578         * Animometer/tests/master/focus.html:
1579         * Animometer/tests/master/image-data.html:
1580         * Animometer/tests/master/multiply.html:
1581         * Animometer/tests/master/particles.html:
1582         * Animometer/tests/misc/canvas-electrons.html:
1583         * Animometer/tests/misc/canvas-stars.html:
1584         * Animometer/tests/misc/compositing-transforms.html:
1585         * Animometer/tests/simple/simple-canvas-paths.html:
1586         * Animometer/tests/simple/tiled-canvas-image.html:
1587         * Animometer/tests/template/template-canvas.html:
1588         * Animometer/tests/template/template-css.html:
1589         * Animometer/tests/template/template-svg.html:
1590         * Animometer/tests/text/layering-text.html:
1591         * Animometer/tests/text/text-boxes.html:
1592
1593         Update test harness reporting.
1594
1595         * Animometer/developer.html: Add missing meta charset.
1596         * Animometer/index.html: Remove unnecessary utf-8 declaration.
1597         * Animometer/resources/debug-runner/animometer.css: Add convenience classes for
1598         formatting the results table.
1599         * Animometer/resources/debug-runner/animometer.js: Adjust which stats are shown.
1600         * Animometer/resources/debug-runner/tests.js: Display bootstrapping statistics.
1601         * Animometer/resources/strings.js: Move strings not used by the release harness.
1602
1603         Switch to a pseudo-random number generator.
1604
1605         * Animometer/resources/statistics.js: Add a Pseudo class, with a simple
1606         pseudo-random number generator.
1607         (_calculateRegression): Reset the generator before running bootstrap.
1608         (bootstrap): Deleted.
1609
1610         Replace Math.random with Pseudo.random.
1611         * Animometer/tests/master/resources/canvas-tests.js:
1612         * Animometer/tests/master/resources/focus.js:
1613         * Animometer/tests/master/resources/particles.js:
1614         * Animometer/tests/resources/main.js:
1615
1616         Use bootstrapping to get confidence interval in the breakpoint.
1617
1618         For the ramp controller, calculate the piecewise regression, and then use
1619         bootstrapping in order to find the 95% confidence interval. Use the raw data.
1620
1621         * Animometer/developer.html: Default to the complexity graph. Add a legend
1622         checkbox to toggle visibility of the bootstrap score and histogram.
1623         * Animometer/resources/debug-runner/animometer.css: Make some more space to show
1624         the old raw and average scores in the legend. Add new styles for the data.
1625         * Animometer/resources/debug-runner/graph.js:
1626         (_addRegressionLine): Allow passing an array for the variance bar tied to the
1627         regression line. Now |stdev| is |range|.
1628         (createComplexityGraph): Add bootstrap median, and overlay a histogram of
1629         the bootstrap samples. Switch raw samples from circles to X's.
1630         (onComplexityGraphOptionsChanged): Allow toggling of the bootstrap data.
1631         (onGraphTypeChanged): Move the regressions for the raw and average samples to the
1632         legend. In the subtitle use the bootstrap median, and include the 95% confidence
1633         interval.
1634         * Animometer/resources/runner/animometer.js:
1635         (this._processData.findRegression): Factor out the code that determines which
1636         samples to include when calculating the piecewise regression. For series that have
1637         many samples, or a wider range of recorded complexities, throw away the 2.5%
1638         lowest and highest samples before calculating the regression. Keep all samples
1639         if the number of samples to regress is small or the range of complexities is
1640         narrow.
1641         (this._processData._calculateScore): Factor out regression calculation to
1642         findRegression(). Bootstrap the change point of the regression. The score is the
1643         median.
1644         * Animometer/resources/statistics.js:
1645         (_calculateRegression): Correct an issue in the calculation of the regression, where
1646         the denominator can be 0.
1647         (bootstrap): Template for bootstrapping. Create a bootstrap sample array, Create
1648         re-samples by random selection with replacement. Return the 95% confidence samples,
1649         the bootstrap median, mean, and the data itself.
1650         * Animometer/resources/strings.js: Add bootstrap.
1651         * Animometer/tests/resources/main.js:
1652         (processSamples): Don't prematurely cut the sample data.
1653
1654         Fix graph drawing.
1655
1656         * Animometer/resources/debug-runner/animometer.js: Add spacing in the JSON output.
1657         Multiple tests output a lot of JSON and can hang when selecting JSON with no whitespace.
1658         * Animometer/resources/debug-runner/animometer.css:
1659         (#complexity-graph .series.raw circle): Update the color.
1660         * Animometer/resources/debug-runner/graph.js: Use the FPS axis instead of the
1661         complexity axis, which can vary in domain. For determining the complexity domain,
1662         only use samples after samplingTimeOffset.
1663
1664         Allow dropping results JSON.
1665
1666         * Animometer/developer.html: Add a button.
1667         * Animometer/resources/debug-runner/animometer.css:
1668         * Animometer/resources/debug-runner/animometer.js: Read the data and go straight
1669         to the dashboard. With JSON output, write out only the options and the raw data.
1670
1671         Teach the harness to evaluate the samples and determine the test score.
1672
1673         This will allow us to update how the score is calculated separately from the samples recorded.
1674         This also prepares the harness to be able to accept JSON of prior runs.
1675
1676         * Animometer/resources/strings.js: Clean up and remove unneeded strings and reduce some of the
1677         hierarchy.
1678         * Animometer/resources/debug-runner/tests.js: Update to use the new strings.
1679
1680         * Animometer/tests/resources/main.js: Allow all controllers to show a complexity-FPS graph.
1681         (_processComplexitySamples): Factor out some of the sample processing done in the ramp
1682         controller for the benefit of the other controllers. |complexitySamples| contains a list of
1683         samples. Sort the samples by complexity. Optionally remove the top x% of samples.
1684         Group them, and calculate distribution of samples within the same complexity, and add those as
1685         new entries into |complexityAverageSamples|.
1686         (Controller.processSamples): Move the code responsible for determining the complexity and FPS
1687         scores out to ResultsDashboard. The structure of the data returned by the controller is:
1688
1689         {
1690             controller: [time-regression, time-regression, ...], // optional, data specific to controller
1691             marks: [...],
1692             samples: {                    // all of the sample data
1693                 controller: [...],
1694                 complexity: [...],        // processed from controller samples
1695                 complexityAverage: [...], // processed from complexity samples
1696             }
1697         }
1698
1699         (AdaptiveController.processSamples): Adding the target frame length is no longer necessary; we
1700         now pass the test options to the graph.
1701         (Regression): Move to statistics.js.
1702         * Animometer/resources/statistics.js: Move Regression to here. Add a check if the sampling range
1703         only contains one sample, since we cannot calculate a regression from one sample point.
1704
1705         Teach the test harness to evaluate the data.
1706         * Animometer/resources/runner/animometer.js:
1707         (ResultsDashboard): Store the options used to run the test and the computed results/score separately
1708         from the data. The results are stored as:
1709
1710         {
1711             score: /* geomean of iteration score */,
1712             iterationsResults: [
1713                 {
1714                     score: /* geomean of tests */,
1715                     testsResults: {
1716                         suiteName: {
1717                             testName: {
1718                                 controller: {
1719                                     average:
1720                                     concern:
1721                                     stdev:
1722                                     percent:
1723                                 },
1724                                 frameLength: { ... },
1725                                 complexity: {
1726                                     complexity:
1727                                     stdev:
1728                                     segment1:
1729                                     segment2:
1730                                 },
1731                                 complexityAverage: { ... }
1732                             },
1733                             testName: { ... },
1734                         },
1735                         ... next suite ...
1736                     }
1737                 },
1738                 { ...next iteration... }
1739             ]
1740         }
1741
1742         * Animometer/resources/debug-runner/animometer.js: Pass options around instead of relying
1743         on what was selected in the form. This will later allow for dropping previous results, and
1744         using those runs' options when calculating scores.
1745         (ResultsTable._addGraphButton): Simplify button action by using attached test data.
1746         * Animometer/resources/debug-runner/graph.js: Refactor to use the data.
1747
1748         Consolidate JS files, and move statistics out to a separate JS.
1749
1750         Preparation for having the Controller only handle recording and storage of the samples,
1751         and leave the evaluation of the test score out to the harness. Move Experiment to
1752         a new statistics.js, where Regression will also eventually go. Get rid of algorithm.js
1753         and move it to utilities.js since the Heap is used only for Experiments.
1754
1755         * Animometer/tests/resources/algorithm.js: Removed. Heap is in utilities.js.
1756         * Animometer/tests/resources/sampler.js: Removed. Experiment is in statistics.js,
1757         Sampler in main.js.
1758         * Animometer/tests/resources/main.js: Move Sampler here.
1759         * Animometer/resources/statistics.js: Added. Move Statistics and Experiment here.
1760         * Animometer/resources/extensions.js: Move Heap here. Attach static method to create
1761         a max or min heap to Heap, instead of a new Algorithm object.
1762
1763         Update JS files.
1764         * Animometer/developer.html:
1765         * Animometer/index.html:
1766         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1767         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1768         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1769         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1770         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1771         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1772         * Animometer/tests/master/canvas-stage.html:
1773         * Animometer/tests/master/focus.html:
1774         * Animometer/tests/master/image-data.html:
1775         * Animometer/tests/master/multiply.html:
1776         * Animometer/tests/master/particles.html:
1777         * Animometer/tests/misc/canvas-electrons.html:
1778         * Animometer/tests/misc/canvas-stars.html:
1779         * Animometer/tests/misc/compositing-transforms.html:
1780         * Animometer/tests/simple/simple-canvas-paths.html:
1781         * Animometer/tests/simple/tiled-canvas-image.html:
1782         * Animometer/tests/template/template-canvas.html:
1783         * Animometer/tests/template/template-css.html:
1784         * Animometer/tests/template/template-svg.html:
1785         * Animometer/tests/text/layering-text.html:
1786         * Animometer/tests/text/text-boxes.html:
1787
1788         Fix the cursor in the graph analysis when the min
1789         complexity is not 0.
1790
1791         * Animometer/resources/debug-runner/graph.js:
1792         (_addRegression):
1793         (createComplexityGraph):
1794
1795 2016-02-23  Geoffrey Garen  <ggaren@apple.com>
1796
1797         Fix some issues in MallocBench
1798         https://bugs.webkit.org/show_bug.cgi?id=154600
1799
1800         Reviewed by Oliver Hunt.
1801
1802         * MallocBench/MallocBench.xcodeproj/project.pbxproj: Make nimlang.ops
1803         a part of the build so that it copies to the right place for execution.
1804
1805         * MallocBench/MallocBench/Interpreter.cpp:
1806         (Interpreter::Interpreter): Don't try to open .ops files for writing
1807         because we're only going to read and we might need extra permissions to
1808         write.
1809
1810         (Interpreter::~Interpreter): Give more context when opening a file fails
1811         to help with debugging.
1812
1813         * MallocBench/MallocBench/stress.cpp:
1814         (benchmark_stress): Reduce iterations to complete in less than 10 seconds.
1815
1816 2016-02-23  Michael Saboff  <msaboff@apple.com>
1817
1818         Unreviewed change to revert extraneous changes made part of change set 196955.
1819
1820         * MallocBench/MallocBench/Interpreter.cpp:
1821         (Interpreter::doMallocOp):
1822         (Interpreter::Thread::switchTo):
1823         (writeData): Deleted.
1824
1825 2016-02-19  Michael Saboff  <msaboff@apple.com>
1826
1827         MallocBench: Added recording for nimlang website, new recording details and added new options
1828         https://bugs.webkit.org/show_bug.cgi?id=154485
1829
1830         Reviewed by Geoff Garen.
1831
1832         Added new capabilities to MallocBench.  These include:
1833             Added a recording of http://nim-lang.org/docs/lib.html.
1834             Added thread id to the recording and the ability to playback switching threads in MallocBench
1835             Added aligned allocations to recordings and the ability to playback
1836             Added --use-thread-id option to honor recorded thread ids
1837             Added --detailed-report to output remaining allocations by size after playback
1838             Added --no-warmup to not run the warm up iteration
1839
1840         Changed the way that options are passed down to the benchmarks.  Instead of passing individual
1841         boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
1842         can access the options that are appropriate.  The Benchmark class also uses the options for
1843         is parallel, run counts and warm up.
1844
1845         Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
1846         for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
1847         16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
1848         without any incompatibilities.
1849
1850         Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
1851         is the same as the last, operation continues as normal.  When the next Op has a different thread id,
1852         we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
1853         assure that only one thread is really running at a time and a condition variable used to wait
1854         that the current thread id matches each block thread's thread id.  This doesn't simulate true
1855         concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.
1856
1857         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
1858         * MallocBench/MallocBench/Benchmark.cpp:
1859         (deallocateHeap):
1860         (Benchmark::Benchmark):
1861         (Benchmark::runOnce):
1862         (Benchmark::run):
1863         * MallocBench/MallocBench/Benchmark.h:
1864         (Benchmark::isValid):
1865         * MallocBench/MallocBench/CommandLine.cpp:
1866         (CommandLine::printUsage):
1867         * MallocBench/MallocBench/CommandLine.h:
1868         (CommandLine::isValid):
1869         (CommandLine::benchmarkName):
1870         (CommandLine::isParallel):
1871         (CommandLine::useThreadID):
1872         (CommandLine::detailedReport):
1873         (CommandLine::warmUp):
1874         (CommandLine::heapSize):
1875         (CommandLine::runs):
1876         * MallocBench/MallocBench/Interpreter.cpp:
1877         (Interpreter::Interpreter):
1878         (Interpreter::run):
1879         (Interpreter::readOps):
1880         (Interpreter::doOnSameThread):
1881         (Interpreter::switchToThread):
1882         (Interpreter::detailedReport):
1883         (compute2toPower):
1884         (writeData):
1885         (Interpreter::doMallocOp):
1886         (Interpreter::Thread::Thread):
1887         (Interpreter::Thread::stop):
1888         (Interpreter::Thread::~Thread):
1889         (Interpreter::Thread::runThread):
1890         (Interpreter::Thread::waitToRun):
1891         (Interpreter::Thread::switchTo):
1892         * MallocBench/MallocBench/Interpreter.h:
1893         (Interpreter::Thread::isMainThread):
1894         * MallocBench/MallocBench/alloc_free.cpp: Added.
1895         (benchmark_alloc_free):
1896         * MallocBench/MallocBench/alloc_free.h: Added.
1897         * MallocBench/MallocBench/balloon.cpp:
1898         (benchmark_balloon):
1899         * MallocBench/MallocBench/balloon.h:
1900         * MallocBench/MallocBench/big.cpp:
1901         (benchmark_big):
1902         * MallocBench/MallocBench/big.h:
1903         * MallocBench/MallocBench/churn.cpp:
1904         (benchmark_churn):
1905         * MallocBench/MallocBench/churn.h:
1906         * MallocBench/MallocBench/facebook.cpp:
1907         (benchmark_facebook):
1908         * MallocBench/MallocBench/facebook.h:
1909         * MallocBench/MallocBench/flickr.cpp:
1910         (benchmark_flickr):
1911         (benchmark_flickr_memory_warning):
1912         * MallocBench/MallocBench/flickr.h:
1913         * MallocBench/MallocBench/fragment.cpp:
1914         (validate):
1915         (benchmark_fragment):
1916         (benchmark_fragment_iterate):
1917         * MallocBench/MallocBench/fragment.h:
1918         * MallocBench/MallocBench/list.cpp:
1919         (benchmark_list_allocate):
1920         (benchmark_list_traverse):
1921         * MallocBench/MallocBench/list.h:
1922         * MallocBench/MallocBench/main.cpp:
1923         (main):
1924         * MallocBench/MallocBench/medium.cpp:
1925         (benchmark_medium):
1926         * MallocBench/MallocBench/medium.h:
1927         * MallocBench/MallocBench/memalign.cpp:
1928         (test):
1929         (benchmark_memalign):
1930         * MallocBench/MallocBench/memalign.h:
1931         * MallocBench/MallocBench/message.cpp:
1932         (benchmark_message_one):
1933         (benchmark_message_many):
1934         * MallocBench/MallocBench/message.h:
1935         * MallocBench/MallocBench/nimlang.cpp: Added.
1936         (benchmark_nimlang):
1937         * MallocBench/MallocBench/nimlang.h: Added.
1938         * MallocBench/MallocBench/nimlang.ops: Added.
1939         * MallocBench/MallocBench/realloc.cpp:
1940         (benchmark_realloc):
1941         * MallocBench/MallocBench/realloc.h:
1942         * MallocBench/MallocBench/reddit.cpp:
1943         (benchmark_reddit):
1944         (benchmark_reddit_memory_warning):
1945         * MallocBench/MallocBench/reddit.h:
1946         * MallocBench/MallocBench/stress.cpp:
1947         (deallocate):
1948         (benchmark_stress):
1949         * MallocBench/MallocBench/stress.h:
1950         * MallocBench/MallocBench/stress_aligned.cpp:
1951         (benchmark_stress_aligned):
1952         * MallocBench/MallocBench/stress_aligned.h:
1953         * MallocBench/MallocBench/theverge.cpp:
1954         (benchmark_theverge):
1955         (benchmark_theverge_memory_warning):
1956         * MallocBench/MallocBench/theverge.h:
1957         * MallocBench/MallocBench/tree.cpp:
1958         (benchmark_tree_allocate):
1959         (benchmark_tree_traverse):
1960         (benchmark_tree_churn):
1961         * MallocBench/MallocBench/tree.h:
1962         * MallocBench/run-malloc-benchmarks:
1963
1964 2016-02-11  Jon Lee  <jonlee@apple.com>
1965
1966         Fix a missing refactoring.
1967
1968         * Animometer/tests/master/resources/multiply.js:
1969         (animate): Move to Utilities.lerp.
1970         (_lerp): Deleted.
1971
1972 2016-02-10  Jon Lee  <jonlee@apple.com>
1973
1974         Add new benchmark tests.
1975         https://bugs.webkit.org/show_bug.cgi?id=154063
1976
1977         Provisionally reviewed by Said Abou-Hallawa.
1978
1979         Add tests for get/put image data, filters, opacity, and css transforms.
1980
1981         * Animometer/resources/runner/benchmark-runner.js:
1982         (_runBenchmarkAndRecordResults): Update the body background color to match that of
1983         the stage.
1984         (this._runNextIteration): Clear the background color style for the results page.
1985         * Animometer/resources/runner/tests.js:
1986         * Animometer/tests/master/focus.html: Added.
1987         * Animometer/tests/master/image-data.html: Added.
1988         * Animometer/tests/master/multiply.html: Added.
1989         * Animometer/tests/master/resources/focus.js: Added.
1990         * Animometer/tests/master/resources/image-data.js: Added.
1991         * Animometer/tests/master/resources/multiply.js: Added.
1992         * Animometer/tests/master/resources/stage.css: Move common styles out.
1993         * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random.
1994         Add Stage.randomSign for randomly setting a direction. Add the notion of the
1995         current timestamp of the test to Benchmark, since some animations cycle through
1996         colors and rely on an incremental counter like the time.
1997
1998 2016-02-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
1999
2000         Add internal benchmark tests for CSS mix-blend-modes and filters
2001         https://bugs.webkit.org/show_bug.cgi?id=154058
2002
2003         Provisionally reviewed by Jon Lee.
2004
2005         * Animometer/resources/debug-runner/tests.js: Include the new tests in the
2006         "HTML suite" of the debug runner.
2007
2008         * Animometer/resources/extensions.js:
2009         (Utilities.browserPrefix):
2010         (Utilities.setElementPrefixedProperty): Utility functions to allow setting
2011         prefixed style properties.
2012
2013         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2014         Set the mix-blend-mode and the filter to some random values if the options
2015         of the test requested that.
2016
2017         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2018         (parseShapeParameters): Parse the url options "blend" and "filter" and set
2019         the corresponding flags.
2020
2021         * Animometer/tests/resources/main.js:
2022         (randomStyleMixBlendMode):
2023         (randomStyleFilter): Return random mix-blend-mode and filter.
2024
2025 2016-02-08  Jon Lee  <jonlee@apple.com>
2026
2027         Add a ramp controller
2028         https://bugs.webkit.org/show_bug.cgi?id=154028
2029
2030         Provisionally reviewed by Said Abou-Hallawa.
2031
2032         Enhance the graph to include a complexity-fps graph, in addition
2033         to the time graph.
2034
2035         * Animometer/developer.html: Add a ramp option.
2036         * Animometer/resources/debug-runner/animometer.css: Update the style.
2037         * Animometer/resources/strings.js: Flatten the Strings.text constants.
2038         * Animometer/resources/debug-runner/animometer.js:
2039         (ResultsTable.call._addGraphButton): Refactor.
2040         (ResultsTable.call._addTest): Add regression data.
2041         (benchmarkController): Add a form that allows the user to switch between the two forms,
2042         Add a form that allows the user to toggle different data. Hide certain header columns
2043         depending on the selected controller.
2044         * Animometer/resources/debug-runner/graph.js: Add the complexity regressions.
2045         * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results.
2046         * Animometer/resources/runner/animometer.js:
2047         (ResultsTable): If a header is disabled don't include them in _flattenedHeaders.
2048         * Animometer/tests/resources/main.js:
2049         (Controller): Allow options to specify the capacity for sample arrays.
2050         (Regression): A piecewise regression that tries to fit a slope and a flat profile.
2051         (_calculateRegression): Options can fix the slope and bias when calculating the minimal
2052         error. Sweep across the samples in time (which could be backward depending on the controller)
2053         and calculate the intersection point.
2054         (RampController): This controller assumes that the target frame rate is below
2055         58 FPS. It runs in two stages. The first stage quickly determines the order of
2056         magnitude of objects needed to stress the system by the setting the complexity
2057         to increasingly difficult tiers. Perform a series of ramps descending from a
2058         high-water mark of complexity. The complexity needed to reach the target frame
2059         length is done by performing a piecewise regression on each ramp, and track a
2060         running average of these values. For the next ramp, make that running average
2061         the center of the ramp. With a minimum complexity of 0, the high-water mark is
2062         twice that average. The score is based on the highest complexity that can
2063         reach 60 fps.
2064
2065 2016-02-08  Jon Lee  <jonlee@apple.com>
2066
2067         Address Said's comments on the benchmark, and do some clean up.
2068
2069         * Animometer/developer.html:
2070         * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
2071         * Animometer/resources/debug-runner/animometer.js: Use the right
2072         Strings constants.
2073         * Animometer/resources/debug-runner/graph.js:
2074         (_addRegressionLine): Add missing code to draw the line and standard
2075         deviation highlight.
2076         (onGraphTypeChanged): Remove unneeded variables
2077         (onTimeGraphOptionsChanged):
2078         * Animometer/resources/runner/benchmark-runner.js:
2079         (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
2080         _suitesSamplers to _suitesResults.
2081         * Animometer/tests/resources/main.js:
2082         (results): Call processSamples().
2083         (update): Change sampling timestamp comparison.
2084         (_animateLoop): Move shouldStop call to before the update.
2085         * Animometer/tests/resources/sampler.js:
2086         (process): Rename to processSamples().
2087
2088 2016-02-07  Jon Lee  <jonlee@apple.com>
2089
2090         Teach Controller to measure intervals, and turn off the frame length estimator.
2091
2092         * Animometer/tests/resources/main.js: Default interval length is 100 ms.
2093         (start): Set the first interval.
2094         (_measureAndResetInterval): Reports the average frame length of the interval that just
2095         completed, and sets up the next interval.
2096         (update): If there is no length, then just use the estimator per frame, otherwise the
2097         estimator measures per interval. Add a didFinishInterval for subclasses to process
2098         prior to recording the sample. Update tune() to include whether an interval had
2099         finished.
2100         (StepController): Step controllers don't measure on an interval basis.
2101
2102 2016-02-07  Jon Lee  <jonlee@apple.com>
2103
2104         Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator
2105         and switch the parameters for start(), update(), and tune(), so that the timestamp
2106         is first and stage is second.
2107
2108         * Animometer/tests/resources/main.js:
2109
2110 2016-02-07  Jon Lee  <jonlee@apple.com>
2111
2112         Move ResultsTable functionality not needed for release tests out.
2113         Move reporting of score and mean to selection of the time-based graph.
2114
2115         * Animometer/developer.html: Rename graph-options to time-graph-options.
2116         * Animometer/resources/debug-runner/animometer.js:
2117         (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean
2118         values to "average" objects which can hold stdev. Move graph button and
2119         calculation of noisy measurements here. Sophisticated header processing
2120         is not needed in release suite.
2121         (populateTable): Use DeveloperResultsTable.
2122         * Animometer/resources/debug-runner/graph.js: Pull time graph creation to
2123         its own function, and add a new onGraphTypeChanged handler in preparation
2124         of a complexity graph to be added later.
2125         * Animometer/resources/runner/animometer.js:
2126         (ResultsTable): Simplify to just handle test names and scores.
2127
2128 2016-02-07  Jon Lee  <jonlee@apple.com>
2129
2130         Tests: reuse objects already made.
2131
2132         Avoid thrash of object creation and removal by maintaining an index that
2133         moves along the array as the adjust values change. If the tune value
2134         requires more objects than the maximum size of the object array, then create
2135         new objects. This means that the object array size never decreases.
2136
2137         * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate
2138         offsetIndex. For these tests, we want to avoid drawing the oldest objects,
2139         so the scene will draw the object at offsetIndex to the end of the array.
2140         (tune): Reverse the logic since "removal" of objects is much simpler and
2141         involves simply changing the offsetIndex.
2142         (animate): Update the for loop to draw from offsetIndex to the end.
2143         (complexity): Update the definition.
2144         * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate
2145         offsetIndex. For these tests, we want to avoid drawing the newest objects,
2146         so the scene will draw the object at index 0 to the object at offsetIndex.
2147         (SimpleCanvasStage.animate): Fly-by removal of local stage variable,
2148         which is unneeded. Update the for loop to draw from offsetIndex to the end.
2149         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2150         (SimpleCanvasStage.animate): Update the for loop to draw from 0 to
2151         offsetIndex.
2152         * Animometer/tests/simple/resources/simple-canvas.js:
2153         (tune): Update logic. Here, offsetIndex represents the boundary of the last
2154         index to render.
2155         (animate): Update the for loop to draw from 0 to offsetIndex.
2156         (complexity): Update the definition.
2157
2158 2016-02-07  Jon Lee  <jonlee@apple.com>
2159
2160         Tests: refactor and update styles.
2161
2162         * Animometer/tests/resources/main.js: Add helper methods that return
2163         a color that hue rotates based on the date, and a counter value that
2164         increases based on the date. Fix randomInt() to not bias against the min and
2165         max values.
2166
2167         * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods.
2168         * Animometer/tests/master/resources/dom-particles.js: Ditto.
2169         * Animometer/tests/master/resources/particles.js: Ditto.
2170         * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to
2171         use a rotating color instead of a random color. The fast switching of color
2172         is too vivid to watch.
2173
2174         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2175         (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so
2176         that the last stop is located at the end.
2177
2178 2016-02-07  Jon Lee  <jonlee@apple.com>
2179
2180         Refactor tune() to not return the complexity of the scene.
2181
2182         We have stage.complexity() now, so returning the complexity through tune
2183         is unnecessary.
2184
2185         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2186         * Animometer/tests/master/resources/canvas-stage.js:
2187         * Animometer/tests/master/resources/particles.js:
2188         * Animometer/tests/misc/resources/canvas-electrons.js:
2189         * Animometer/tests/misc/resources/canvas-stars.js:
2190         * Animometer/tests/resources/main.js:
2191         * Animometer/tests/simple/resources/simple-canvas.js:
2192         * Animometer/tests/simple/resources/tiled-canvas-image.js:
2193         * Animometer/tests/template/resources/template-canvas.js:
2194         * Animometer/tests/template/resources/template-css.js:
2195         * Animometer/tests/template/resources/template-svg.js:
2196         * Animometer/tests/text/resources/layering-text.js:
2197
2198 2016-02-07  Jon Lee  <jonlee@apple.com>
2199
2200         Make the fixed controller a step controller instead. Halfway through the test
2201         it will bump up the complexity 4-fold. Calculate the step timestamp using options
2202         instead of a separate parameter to the Controller constructor.
2203
2204         * Animometer/developer.html: Change value to "step"
2205         * Animometer/resources/debug-runner/animometer.js:
2206         (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
2207         * Animometer/tests/resources/main.js:
2208         (update): Provide a hook for subclasses to tune.
2209         (StepController): Maintain a flag determining whether we've stepped, and the time
2210         we should step.
2211         (Benchmark): Use the new StepController.
2212
2213 2016-02-07  Jon Lee  <jonlee@apple.com>
2214
2215         Adjust the FPS graph scale.
2216
2217         Instead of making the FPS graph linearly scale, scale it based on the frame length,
2218         but show the data in terms of FPS. Because it is inversely proportional, and most
2219         of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise
2220         over half of the available graph space ends up blank.
2221
2222         This means we should convert all of the FPS data to frame length data.
2223
2224         * Animometer/resources/debug-runner/graph.js: Update the domain to be based on
2225         frame length in milliseconds instead of FPS. Update the cursor to consider all of the
2226         values being shown, and then pick the min and max values to represent the length of the
2227         cursor.
2228         * Animometer/resources/runner/animometer.js:
2229         * Animometer/resources/strings.js:
2230         * Animometer/tests/resources/main.js:
2231         (processSamples): Add the ability to only sample a range of the data instead of everything
2232         after an offset index. Update sampler to record the frame lengths instead of the frame
2233         rate.
2234
2235 2016-02-07  Jon Lee  <jonlee@apple.com>
2236
2237         Add option to use different methods for retrieving a timestamp.
2238
2239         * Animometer/developer.html: Add performance.now and Date.now options.
2240         * Animometer/resources/runner/animometer.js: Default to performance.now.
2241         (window.benchmarkController.startBenchmark):
2242         * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp.
2243         (run): Use _getTimestamp.
2244         (_animateLoop): Ditto.
2245
2246 2016-02-07  Jon Lee  <jonlee@apple.com>
2247
2248         Allow adding any number of markers to the graph. The markers can be labeled
2249         and contain timestamp and sample index data. Make it a part of the controller
2250         rather than keeping it in the sampler.
2251
2252         * Animometer/resources/debug-runner/animometer.css: Add styles for markers
2253         * Animometer/resources/debug-runner/graph.js: Create the markers and add
2254         text labels.
2255         * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset
2256         is just one of the marks provided.
2257         * Animometer/resources/strings.js: Add Strings.json.marks.
2258         * Animometer/tests/resources/main.js:
2259         (Controller): Keep marks here. They are keyed by the marker name, so no two
2260         markers should have the same name.
2261         (recordFirstSample): Refactor to use mark.
2262         (mark): Allows for arbitrary data if needed later. The timestamp maintained
2263         is relative to the absolute start timestamp.
2264         (containsMark): Checks whether a mark with a specific comment exists.
2265         (processSamples): Removes the _startTimestamp offset from the marks before
2266         setting it in results.
2267         * Animometer/tests/resources/sampler.js: Remove marks.
2268
2269 2016-02-07  Jon Lee  <jonlee@apple.com>
2270
2271         Get rid of options member variable in Benchmark.
2272
2273         Options are only needed when initializing the stage or benchmark, so there's no
2274         need to also keep a reference to it.
2275
2276         * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark.
2277         Pass options to Controllers and Stages.
2278         (Controller.Utilities.createClass):
2279         (Benchmark.Utilities.createClass):
2280         (get options): Deleted.
2281
2282         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2283         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2284         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2285         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2286         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2287         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2288         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2289         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2290         * Animometer/tests/master/resources/canvas-stage.js:
2291         * Animometer/tests/master/resources/canvas-tests.js:
2292         * Animometer/tests/master/resources/particles.js:
2293         * Animometer/tests/misc/resources/canvas-electrons.js:
2294         * Animometer/tests/misc/resources/canvas-stars.js:
2295         * Animometer/tests/misc/resources/compositing-transforms.js:
2296         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2297         * Animometer/tests/simple/resources/tiled-canvas-image.js:
2298         * Animometer/tests/template/resources/template-canvas.js:
2299         * Animometer/tests/template/resources/template-css.js:
2300         * Animometer/tests/template/resources/template-svg.js:
2301         * Animometer/tests/text/resources/layering-text.js:
2302
2303 2016-02-07  Jon Lee  <jonlee@apple.com>
2304
2305         Update how the benchmark is run
2306         https://bugs.webkit.org/show_bug.cgi?id=153960
2307
2308         Provisionally reviewed by Said Abou-Hallawa.
2309
2310         Introduce the notion of a Controller. It is responsible for recording, updating,
2311         and processing the statistics and complexity of the benchmark. This allows
2312         plugging in different Controllers.
2313
2314         This strips most of the functionality from Animator and BenchmarkState, so fold
2315         what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but
2316         are responsible for driving the animation loop.
2317
2318         Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One
2319         maintains a fixed complexity, and the other adapts the complexity to meet a
2320         fixed FPS.
2321
2322         Fix the Kalman estimator to be modeled on a scalar variable with no model.
2323
2324         * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and
2325         replace it with a Controller. Add a FixedController and refactor the previous controller
2326         to an AdaptiveController.
2327
2328         (Controller): Controllers own the estimator and the sampler. When a new frame is
2329         displayed, the animation loop calls update(). The estimator and sampler record
2330         stats, then tune. Samplers can track multiple series of data. The basic controller
2331         tracks timestamp, complexity, and estimated frame rate.
2332                 The Kalman estimation is based on the frame length rather than the frame
2333         rate. Because FPS is inverse proportional to frame length, in the case where the measured
2334         frame length is very small, the FPS ends up being a wildly large number (in the order of
2335         600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while
2336         for it to settle back down. Using frame length reduces the impact of these spikes.
2337                 Converging the estimation takes enough time to avoid initializing it immediately
2338         when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms)
2339         before running it in earnest. Allow controllers an opportunity to set the complexity
2340         before starting recording.
2341                 When the benchmark is complete, the controller has an opportunity to process
2342         the samples. The default implementation calculates the raw FPS based on the time
2343         difference of the samples, and calculates the complexity score. This is moved from
2344         Benchmark.processSamples.
2345
2346         (Controller): Initialize timestamps. These are at first relative to the start of the
2347         benchmark, but are offset by the absolute start time during start(). By default maintain
2348         3 data series, but subclasses can override.
2349         (start): Calls recordFirstSample() for subclasses to override if needed.
2350         (recordFirstSample): For basic controller, start sampling at the beginning.
2351         (update): Update the frame length estimator and sample.
2352         (shouldStop): Checks that the time is before _endTimestamp.
2353         (results): Returns the processed samples.
2354         (processSamples): Iterate through the sample data and collate them. Include scores.
2355
2356         (FixedComplexityController): Controller that tunes the stage to the desired complexity
2357         prior to starting, and keeps it at that complexity.
2358
2359         (AdaptiveController): Have the estimator estimate the interval frame rate instead of the
2360         raw frame rate.
2361                 The previous version of this controller ignored the frame that came after the
2362         adjustment. The raw FPS show that whatever noise the scene change adds is negligible
2363         compared to the noise of the system overall. Stop ignoring that frame and include all
2364         frames in the measurements.
2365
2366         (Benchmark): Remove dependency on animator, and instantiate a runner based on what is
2367         selected. Most of the loop's functionality is in Controller, so remove here.
2368         (Benchmark.run): Remove start() since it is only called from run(), and fold it in here.
2369         (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for
2370         a brief period before calling Controller.start().
2371
2372         * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates
2373         a scalar variable, and makes basic assumptions regarding the model. As a result
2374         none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3.
2375         (SimpleKalmanEstimator): Calculate the gain based on the provided process and
2376         measurement errors.
2377         (KalmanEstimator): Deleted.
2378         (IdentityEstimator): Deleted.
2379         (PIDController): Refactor to use the Utilities.createClass() helper.
2380
2381         The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/.
2382         The state, represented by a scalar, is the estimated frame length. There is no user
2383         transition of the state, and the state is the same as the measurement. With this model,
2384         the estimation error converges, so calculate the gain ahead of time.
2385
2386         * Animometer/developer.html: Remove fixed-after-warmup since it is not useful.
2387         Replace the option to toggle the estimator, and make it possible to customize the
2388         estimator's error parameters. Show raw FPS by default, and remove interval FPS,
2389         which will be shown instead of the filtered raw FPS.
2390         * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph.
2391         Remove #intervalFPS rules; move the color to #filteredFPS.
2392         * Animometer/resources/debug-runner/graph.js:
2393         (updateGraphData): Update the hr style to force the layout to be calculated
2394         correctly. Change the tick format to be in terms of seconds, since the timestamps
2395         are in milliseconds. Remove interval data.
2396         * Animometer/resources/runner/animometer.js:
2397         (window.benchmarkController.startBenchmark): Set Kalman parameters.
2398         * Animometer/resources/runner/benchmark-runner.js:
2399         (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return
2400         the final data, rather than passing a sampler from the controller. This avoids
2401         needing to expose the sampler variable in the benchmark.
2402         * Animometer/tests/resources/sampler.js:
2403         (process): Move the setting of the target frame rate to AdaptiveController.
2404
2405 2016-02-06  Jon Lee  <jonlee@apple.com>
2406
2407         Code clean up: Move Rotater function closer to Stage static methods.
2408         The Rotater is used together with those methods; keep them close.
2409
2410         * Animometer/tests/resources/main.js:
2411
2412 2016-02-06  Jon Lee  <jonlee@apple.com>
2413
2414         Update the JS includes due to ResultsTable move.
2415
2416         * Animometer/developer.html:
2417         * Animometer/index.html:
2418
2419 2016-02-06  Jon Lee  <jonlee@apple.com>
2420
2421         Move createElement and createSVGElement to Utilities.
2422
2423         * Animometer/resources/extensions.js:
2424         (Utilities.createElement): Added.
2425         (Utilities.createSVGElement): Added.
2426         (DocumentExtension.createElement): Deleted.
2427         (DocumentExtension.createSvgElement): Deleted.
2428
2429         * Animometer/resources/debug-runner/animometer.js:
2430         * Animometer/resources/runner/animometer.js:
2431         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2432         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
2433         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2434
2435 2016-02-06  Jon Lee  <jonlee@apple.com>
2436
2437         Add a convenience function for creating a class.
2438
2439         The pattern for creating a class is common enough to add as a Utilities
2440         helper function. It also makes it easy to collapse class definitions when
2441         editing.
2442
2443         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
2444         since it is only used here.
2445         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
2446         ResultsTable definition, since it is only used here.
2447         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
2448         Point, Insets, SimplePromise.
2449         (ProgressBar): Moved to animometer.js.
2450         (ResultsDashboard): Moved to animometer.js.
2451         (ResultsTable): Moved to animometer.js.
2452         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
2453         BenchmarkRunner.
2454         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
2455         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
2456
2457         Convert test primitives.
2458         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
2459         CanvasArc, CanvasLinePoint.
2460         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
2461         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
2462         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
2463         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
2464         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
2465
2466 2016-02-06  Jon Lee  <jonlee@apple.com>
2467
2468         Minor improvements to debug harness.
2469
2470         * Animometer/developer.html:
2471         * Animometer/resources/debug-runner/animometer.css:
2472         (#suites): Put the complexity text boxes closer to the test names.
2473         (#options):
2474         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
2475         (#intervalFPS path):
2476         (#intervalFPS circle):
2477         * Animometer/resources/debug-runner/animometer.js:
2478         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
2479         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
2480         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
2481         input will automatically select that test for running.
2482         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
2483         browsing.
2484         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
2485         more accuracy in timestamps.
2486
2487 2016-02-06  Jon Lee  <jonlee@apple.com>
2488
2489         Refactor helper methods for getting random values for a stage.
2490
2491         Instead of requiring a Stage instance, just attach it to the Stage object.
2492
2493         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2494         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2495         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2496         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2497         * Animometer/tests/master/resources/canvas-tests.js:
2498         * Animometer/tests/master/resources/particles.js:
2499         * Animometer/tests/misc/resources/canvas-electrons.js:
2500         * Animometer/tests/misc/resources/canvas-stars.js:
2501         * Animometer/tests/misc/resources/compositing-transforms.js:
2502         * Animometer/tests/resources/main.js:
2503         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2504
2505 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2506
2507         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
2508         https://bugs.webkit.org/show_bug.cgi?id=151716
2509
2510         Reviewed by Darin Adler.
2511
2512         The purpose of this test is to measure the performance of getImageData
2513         and putImageData functions. This test draws a background on the canvas
2514         and then gets some random tiles from this background and draw them in
2515         destinations different from their original sources.
2516
2517         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
2518
2519         * Animometer/resources/extensions.js:
2520         (Array.prototype.shuffle): Shuffles the elements of an array.
2521
2522         (Point.zero): Returns a new Point object whose x and y are equal zero.
2523         (Point.prototype.str): Used for debugging the Point object.
2524
2525         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
2526         (CanvasImageTile):
2527         (CanvasImageTile.prototype.getImageData):
2528         (CanvasImageTile.prototype.putImageData):
2529         (Stage.call.initialize):
2530         (Stage.call._createTiles):
2531         (Stage.call._nextTilePosition):
2532         (Stage.call.tune):
2533         (Stage.call._drawBackground):
2534         (Stage.call.animate):
2535         (Stage.call.complexity):
2536         (Stage.call):
2537         * Animometer/tests/simple/tiled-canvas-image.html: Added.
2538
2539 2016-01-07  Jon Lee  <jonlee@apple.com>
2540
2541         Fix new test.
2542
2543         * Animometer/resources/runner/tests.js: Wrong URL from an
2544         old patch.
2545         * Animometer/tests/master/particles.html:
2546         * Animometer/tests/master/resources/dom-particles.js:
2547         (Particle.call.reset): Figured out a simpler way to set up
2548         the particles.
2549         (this.move.reset): Deleted.
2550         (this.move._applyAttributes): Deleted.
2551         * Animometer/tests/master/resources/particles.js:
2552         (Particle): Call move() after reset().
2553
2554 2016-01-07  Jon Lee  <jonlee@apple.com>
2555
2556         Update benchmark test suite
2557         https://bugs.webkit.org/show_bug.cgi?id=152679
2558
2559         Reviewed by Simon Fraser.
2560
2561         Add a new test. The test has a rotating background
2562         gradient, and does a better job physically simulating
2563         particles.
2564
2565         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
2566         (Point.prototype.length): Added.
2567         (Point.prototype.normalize): Added.
2568         * Animometer/resources/runner/tests.js: Add the test to the master suite.
2569         * Animometer/tests/master/particles.html: Added.
2570         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
2571         (Particle):
2572         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
2573         reset it.
2574         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
2575         (Particle.prototype.move): Subclasses should override.
2576         (ParticlesStage): Stage includes a rotating gradient background.
2577         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
2578         the stage.
2579         * Animometer/tests/resources/star.svg: Added.
2580
2581 2016-01-03  Jon Lee  <jonlee@apple.com>
2582
2583         Update benchmark test suite
2584         https://bugs.webkit.org/show_bug.cgi?id=152679
2585
2586         Reviewed by Simon Fraser.
2587
2588         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
2589
2590         Needed by both harnesses.
2591         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
2592         * Animometer/developer.html:
2593         * Animometer/index.html:
2594
2595         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
2596         into extensions.js.
2597         * Animometer/resources/extensions.js:
2598         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
2599         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
2600         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
2601         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
2602         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2603         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2604         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
2605         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
2606         * Animometer/tests/master/canvas-stage.html:
2607         * Animometer/tests/misc/canvas-electrons.html:
2608         * Animometer/tests/misc/canvas-stars.html:
2609         * Animometer/tests/misc/compositing-transforms.html:
2610         * Animometer/tests/simple/simple-canvas-paths.html:
2611         * Animometer/tests/template/template-canvas.html:
2612         * Animometer/tests/template/template-css.html:
2613         * Animometer/tests/template/template-svg.html:
2614         * Animometer/tests/text/layering-text.html:
2615         * Animometer/tests/text/text-boxes.html:
2616
2617 2016-01-07  Jon Lee  <jonlee@apple.com>
2618
2619         Update benchmark test suite
2620         https://bugs.webkit.org/show_bug.cgi?id=152679
2621
2622         Reviewed by Simon Fraser.
2623
2624         Fix tests for other browsers.
2625
2626         * Animometer/resources/extensions.js:
2627         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
2628         Use getBoundingClientRect() instead.
2629         * Animometer/tests/misc/resources/canvas-electrons.js:
2630         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
2631
2632 2016-01-07  Jon Lee  <jonlee@apple.com>
2633
2634         Add a waitUntilReady() step
2635         https://bugs.webkit.org/show_bug.cgi?id=152862
2636
2637         Reviewed by Simon Fraser.
2638
2639         Add a waitUntilReady() callback that lets the benchmark complete
2640         its setup before running the benchmark.
2641
2642         * Animometer/tests/resources/main.js:
2643         (Benchmark.prototype.run): First call waitUntilReady, which returns
2644         a promise. When the promise resolves, run everything that was in this
2645         function.
2646         (Benchmark.prototype.waitUntilReady): Default implementation returns
2647         a resolved promise.
2648         (Benchmark.prototype.resolveWhenFinished): Deleted.
2649         * Animometer/tests/template/resources/template-canvas.js:
2650         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
2651
2652 2016-01-03  Jon Lee  <jonlee@apple.com>
2653
2654         Update data reporting and analysis
2655         https://bugs.webkit.org/show_bug.cgi?id=152670
2656
2657         Reviewed by Simon Fraser.
2658
2659         Show new graph data. Provide controls to show different series data. Provide an
2660         interactive cursor that shows the data at a given sample.
2661
2662         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
2663         has a checkbox for visual toggling, as well as companion spans to contain the data.
2664                 The numbers will always be shown even if the SVG isn't.
2665         * Animometer/resources/debug-runner/animometer.css:
2666         (#suites): Adjust spacing when doing fixed complexity.
2667         (#test-graph nav): Place the nav in the upper right corner.
2668         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
2669         that scale. Allow it to show.
2670         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
2671         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
2672         (#cursor circle):
2673         (#complexity path): This and rules afterward are named by series type.
2674         (#complexity circle):
2675         (#filteredFPS path):
2676         (#filteredFPS circle):
2677         (#rawFPS path):
2678         (#intervalFPS circle):
2679         (.left-samples): Deleted.
2680         (.right-samples): Deleted.
2681         * Animometer/resources/debug-runner/animometer.js:
2682         (initialize): Add a "changed" listener when the checkboxes change in the nav.
2683         (onBenchmarkOptionsChanged): Renamed.
2684         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
2685         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
2686         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
2687         toggles the data on and off.
2688         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
2689         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
2690         everything add a transparent area which will catch all of the mouse events. When the mouse
2691         moves in the graph, find the closest data point, show the data in the nav area, and highlight
2692         the data points.
2693         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
2694         size a little larger than the circle radius for the data points.
2695         (onGraphOptionsChanged): Called when data is visually toggled.
2696         (showOrHideNodes): Helper function to toggle the .hidden class.
2697         * Animometer/resources/extensions.js:
2698         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
2699         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
2700
2701         Producing the JSON can take a while with all of the data. Make it on-demand with a
2702         button.
2703
2704         * Animometer/resources/debug-runner/animometer.js:
2705         (showResults): When showing the results, don't serialize the JSON data. Move that to...
2706         (showJSONResults): ...here. Remove the button.
2707
2708         * Animometer/developer.html: Add a button. The button will remove itself and populate
2709         the textarea with the JSON data.
2710         * Animometer/resources/debug-runner/animometer.css:
2711         (.hidden): Add a universal hidden class.
2712         (#results button.small-button): Promote the small-button styles to the whole results
2713         section for use in the JSON button.
2714         (#results button.small-button:active):
2715         (#results-data button.small-button): Deleted.
2716         (#results-data button.small-button:active): Deleted.
2717
2718         Refactor how Animator does its recording.
2719
2720         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
2721         the same interval frame rate for adjustment.
2722         * Animometer/tests/resources/main.js:
2723         (Animator): Remove _dropFrameCount, and make variables more accurate described.
2724         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
2725         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
2726         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
2727         of the scene. If we are within the number of frames to measure for the interval, just
2728         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
2729         the interval frame rate and the estimator's frame rate.
2730
2731         Avoid processing the data through the Experiment while the test is running. Reconfigure
2732         the sampler to just record the raw samples. After the test is done, run the samples through
2733         the Experiment to get the score.
2734
2735         * Animometer/resources/sampler.js:
2736         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
2737         needed until the test concludes, so remove startSampling(). Clients should just call sample().
2738         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
2739         of how many samples will be used. The processor is a called when it's time to process the data
2740         since that is the client also telling the Sampler what to record.
2741                 Introduce the notion of marks as well, which allows the client to mark when an
2742         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
2743         it separately.
2744         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
2745         (Sampler.prototype.record): The data to record is passed in as variable arguments.
2746         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
2747         can provide extra data object for later retrieval.
2748         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
2749         Call the processor to process the samples.
2750         * Animometer/resources/debug-runner/benchmark-runner.js:
2751         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
2752
2753         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
2754         not used.
2755         * Animometer/tests/resources/main.js:
2756         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
2757         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
2758         of the data being added to the Sampler. It is added through record(), and processed through
2759         processSamples().
2760         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
2761         the timestamp in the custom data for the mark. This avoids the need to store is separately in
2762         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
2763         record() now just relays the information to the sampler.
2764         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
2765         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
2766         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
2767                 Go through all of the samples. All samples contain a timestamp and complexity. We
2768         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
2769         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
2770         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
2771         the experiments. Grab those scores and add them into results also.
2772
2773         Add complexity() to the tests for Benchmark.record().
2774         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2775         * Animometer/tests/misc/resources/canvas-electrons.js:
2776         * Animometer/tests/misc/resources/canvas-stars.js:
2777         * Animometer/tests/text/resources/layering-text.js:
2778
2779 2015-12-27  Jon Lee  <jonlee@apple.com>
2780
2781         Simplify the test harness
2782         https://bugs.webkit.org/show_bug.cgi?id=152562
2783
2784         Reviewed by Simon Fraser.
2785
2786         Update the simple canvas tests. For the paths, start from the center instead of the
2787         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
2788         use that along both the x and y axes, so that more capable tests use more of the
2789         canvas.
2790
2791         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2792         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
2793         (CanvasQuadraticPoint): Ditto.
2794         (CanvasBezierPoint): Ditto.
2795         * Animometer/tests/simple/resources/simple-canvas.js:
2796         (tune): Calculate a factor instead of a maximum coordinate.
2797
2798 2015-12-27  Jon Lee  <jonlee@apple.com>
2799
2800         Simplify the test harness
2801         https://bugs.webkit.org/show_bug.cgi?id=152562
2802
2803         Reviewed by Simon Fraser.
2804
2805         All of the benchmarks use the default Animator(). Don't require new tests
2806         to pass a new instance, and instead just make one in the Benchmark constructor.
2807
2808         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
2809         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
2810         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2811         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2812         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2813         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2814         * Animometer/tests/master/resources/canvas-tests.js:
2815         * Animometer/tests/misc/resources/canvas-electrons.js:
2816         * Animometer/tests/misc/resources/canvas-stars.js:
2817         * Animometer/tests/misc/resources/compositing-transforms.js:
2818         * Animometer/tests/resources/main.js:
2819         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2820         * Animometer/tests/template/resources/template-canvas.js:
2821         * Animometer/tests/template/resources/template-css.js:
2822         * Animometer/tests/template/resources/template-svg.js:
2823         * Animometer/tests/text/resources/layering-text.js:
2824         * Animometer/tests/text/resources/text-boxes.js:
2825
2826         Refactor the template.
2827
2828         * Animometer/tests/template/resources/template-canvas.js:
2829         * Animometer/tests/template/resources/template-css.js:
2830         * Animometer/tests/template/resources/template-svg.js:
2831         * Animometer/tests/template/template-canvas.html:
2832         * Animometer/tests/template/template-css.html:
2833         * Animometer/tests/template/template-svg.html:
2834
2835         Refactor the SVG suite.
2836
2837         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
2838         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
2839
2840         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
2841         to stage.js.
2842         * Animometer/tests/text/text-boxes.html: Ditto.
2843
2844         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
2845         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
2846         BouncingCanvasParticlesBenchmark.
2847         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
2848         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
2849
2850         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
2851         in the constructor instead of having subclasses set the private variable.
2852
2853         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
2854         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2855
2856         Refactor the HTML suite.
2857
2858         Move scripts to the end.
2859         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2860         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2861         * Animometer/tests/text/layering-text.html:
2862         * Animometer/tests/text/text-boxes.html:
2863
2864         Refactor to use the new variables.
2865         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
2866         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
2867         * Animometer/tests/text/resources/layering-text.js:
2868         * Animometer/tests/text/resources/text-boxes.js:
2869
2870         Refactor the bouncing canvas tests.
2871
2872         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
2873         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
2874
2875         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
2876         properties to "public" since they are used by subclasses.
2877         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
2878         "public" for subclasses.
2879         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
2880         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
2881
2882         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
2883         BouncingCanvasParticlesAnimator is no longer needed.
2884         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
2885         having subclasses set the variable.
2886
2887         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
2888         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
2889
2890         Move example/ files into misc/.
2891
2892         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
2893         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
2894         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
2895         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
2896
2897         * Animometer/resources/debug-runner/tests.js: Update test URLs.
2898
2899         Refactor miscellaneous suite.
2900
2901         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2902         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
2903         not needed.
2904         (tune): Remove console assert.
2905         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
2906
2907         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
2908         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
2909         * Animometer/tests/misc/resources/compositing-transforms.js:
2910         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
2911         * Animometer/tests/examples/canvas-stars.html: Ditto.
2912         * Animometer/tests/misc/compositing-transforms.html: Ditto.
2913
2914         Refactor the simple suite.
2915
2916         * Animometer/tests/master/resources/canvas-stage.js:
2917         (tune): Remove coordinateMaximum since it is not needed in any
2918         of the master tests.
2919         * Animometer/tests/simple/resources/simple-canvas.js:
2920         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
2921         needed.
2922         (tune): Manage the objects differently, but instead of duplicating
2923         all of SimpleCanvasStage here, just replace tune(). Include
2924         coordinateMaximum, and remove items from the end of the list
2925         instead of the beginning.
2926         (StageBenchmark.call.createAnimator): Deleted.
2927         (StageBenchmark.call): Deleted.
2928         * Animometer/tests/simple/resources/simple-canvas-paths.js:
2929         * Animometer/tests/simple/simple-canvas-paths.html: Move
2930         scripts to the end.
2931
2932         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
2933
2934         * Animometer/resources/debug-runner/animometer.js:
2935         (initialize): Move the setting of testsCount to the debug runner.
2936         (didRunTest): Nicer name.
2937         * Animometer/resources/debug-runner/benchmark-runner.js:
2938         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
2939         * Animometer/resources/extensions.js:
2940         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
2941         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
2942         * Animometer/resources/runner/animometer.js:
2943         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
2944         * Animometer/resources/strings.js: These are no longer needed.
2945         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
2946         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
2947         * Animometer/tests/resources/main.js: Messages are no longer needed
2948         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
2949         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
2950         (BenchmarkState.prototype.currentStage): Deleted.
2951         (BenchmarkState.prototype.currentMessage): Deleted.
2952         (BenchmarkState.prototype.currentProgress): Deleted.
2953         (Animator.prototype.animate): Deleted.
2954         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
2955         (Benchmark.prototype.record): No need to update the progress bar.
2956         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
2957
2958         * Animometer/resources/debug-runner/benchmark-runner.js:
2959         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
2960         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
2961         directly.
2962
2963         Make the class relationships more easily understandable. The benchmark owns the stage,
2964         animator, and options. Make the stage and animator no longer have their own references to
2965         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
2966         will try to get rid of stage.js altogether.
2967         * Animometer/tests/resources/main.js:
2968         (Stage): Moved from stage.js.
2969         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
2970         by benchmark-related parameters in initialize().
2971         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
2972         (Animator.prototype.get benchmark):
2973         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
2974         the options dictionary.
2975         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
2976         them.
2977         (Benchmark.prototype.get options):
2978         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
2979         (Benchmark.prototype.get animator):
2980         (Benchmark.prototype.start):
2981         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
2982         level of indirection.
2983         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
2984         path, since tests can be individually selected, and remove the need for runBenchmark since that is
2985         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
2986         * Animometer/tests/resources/stage.js:
2987         (Stage): Deleted. Moved to main.js.
2988         (StageBenchmark): What's left is updating the progress bar; to be removed.
2989         (StageAnimator): What's left can be folded in Animator.
2990
2991         Refactor master suite.
2992         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
2993         (animate): Push the clearRect() into each stage.
2994         (complexity):
2995         (StageBenchmark.call.createAnimator): Deleted.
2996         (StageBenchmark.call): Deleted.
2997         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
2998         (CanvasLineSegment.prototype.draw):
2999         (CanvasArc):
3000         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
3001         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
3002         function call. Do all of the drawing through the stage.
3003
3004         Refactor the subclass pattern. Introduce Utilities.createSubclass().
3005
3006         * Animometer/resources/debug-runner/benchmark-runner.js:
3007         * Animometer/resources/extensions.js:
3008         (window.Utilities.createSubclass): Takes the super class, a function representing
3009         the class's constructor, and additional methods to attach to the new class's
3010         prototype object.
3011         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
3012
3013         Refactor tests.
3014         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
3015         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
3016         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
3017         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
3018         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
3019         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
3020         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
3021         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
3022         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
3023         * Animometer/tests/examples/resources/canvas-electrons.js:
3024         * Animometer/tests/examples/resources/canvas-stars.js:
3025         * Animometer/tests/master/resources/canvas-stage.js:
3026         * Animometer/tests/master/resources/canvas-tests.js:
3027         * Animometer/tests/misc/resources/compositing-transforms.js:
3028         * Animometer/tests/resources/stage.js:
3029         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3030         * Animometer/tests/simple/resources/simple-canvas.js:
3031         * Animometer/tests/template/resources/template-canvas.js:
3032         * Animometer/tests/template/resources/template-css.js:
3033         * Animometer/tests/template/resources/template-svg.js:
3034         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
3035         and properties since they rely on each other.
3036         * Animometer/tests/text/resources/text-boxes.js:
3037
3038         * Animometer/resources/debug-runner/animometer.js: Arrange calls
3039         in the order they are evoked.
3040         * Animometer/resources/debug-runner/benchmark-runner.js:
3041         (BenchmarkRunnerState.prototype.next): Get rid of return value since
3042         no caller to next() uses it.
3043         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
3044         promise to resolve simply when onload() is called instead of
3045         looking for #stage.
3046         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
3047         simply calls runBenchmark(). Call it directly rather than through
3048         the Suite.
3049         (BenchmarkRunner.prototype.step): Remove unused parameter in
3050         resolve callback.
3051         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
3052         of self since it is outside of the closure which needed the self
3053         variable.
3054         (resolveIfReady): Deleted.
3055         (BenchmarkRunner.prototype.waitForElement): Deleted.
3056         * Animometer/resources/runner/tests.js: prepare() and run() are
3057         no longer needed.
3058         (Suite.prototype.prepare): Deleted.
3059         (Suite.prototype.run): Deleted.
3060         * Animometer/tests/master/canvas-stage.html: Move all scripts to
3061         the end of the page.
3062
3063 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
3064
3065         Add an Animometer developer test which animates text-rich boxes
3066         https://bugs.webkit.org/show_bug.cgi?id=152544
3067
3068         Reviewed by Zalan Bujtas.
3069
3070         Add a test that draws lots of international text. This is a particle test,
3071         moving the boxes around with absolution positioning.
3072
3073         * Animometer/resources/debug-runner/tests.js:
3074         * Animometer/tests/text/resources/text-boxes.js: Added.
3075         (BouncingTextBox):
3076         (BouncingTextBox.prototype._move):
3077         (BouncingTextBox.prototype.animate):
3078         (BouncingTextBoxStage):
3079         (BouncingTextBoxStage.prototype.createParticle):
3080         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
3081         (BouncingTextBoxsBenchmark):
3082         (BouncingTextBoxsBenchmark.prototype.createStage):
3083         (window.benchmarkClient.create):
3084         * Animometer/tests/text/text-boxes.html: Added.
3085
3086 2015-12-23  Jon Lee  <jonlee@apple.com>
3087
3088         Split benchmark into two different pages
3089         https://bugs.webkit.org/show_bug.cgi?id=152458
3090
3091         Reviewed by Simon Fraser.
3092
3093         Add tests to 'animometer' suite.
3094
3095         * Animometer/resources/runner/tests.js:
3096         * Animometer/tests/master/canvas-stage.html: Added.
3097         * Animometer/tests/master/resources/canvas-stage.js: Added.
3098         * Animometer/tests/master/resources/canvas-tests.js: Added.
3099         * Animometer/tests/master/resources/stage.css: Added.
3100
3101 2015-12-23  Jon Lee  <jonlee@apple.com>
3102
3103         Split benchmark into two different pages
3104         https://bugs.webkit.org/show_bug.cgi?id=152458
3105
3106         Reviewed by Simon Fraser.
3107
3108         Address comments.
3109
3110         * Animometer/resources/debug-runner/benchmark-runner.js:
3111         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
3112         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
3113         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
3114         * Animometer/resources/extensions.js:
3115         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
3116         (Array.prototype.find.Array.prototype.find): Update the null check.
3117         (ResultsDashboard.prototype._processData): Use the already-processed data.
3118         * Animometer/resources/runner/animometer.css:
3119         (.frame-container > iframe): Remove calc().
3120
3121         Move Array functions to extensions.js since that is included by the harness.
3122         Add ES6 Array polyfills.
3123
3124         * Animometer/resources/algorithm.js:
3125         (Array.prototype.swap): Moved to extensions.js.
3126         * Animometer/resources/extensions.js:
3127         (Array.prototype.swap):
3128         (Array.prototype.fill): Added.
3129         (Array.prototype.find): Added.
3130
3131         Adjust styles for iPad.
3132
3133         * Animometer/resources/runner/animometer.css:
3134         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
3135         (@media screen and (max-device-width: 1024px)): Update width for iPads.
3136
3137         Adjustment styles for iOS.
3138
3139         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
3140         update the style rules.
3141         * Animometer/index.html:
3142         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
3143         (@media screen and (min-device-width: 1800px)): Move this up.
3144         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
3145
3146         Get rid of prefixed flex properties for now.
3147
3148         * Animometer/resources/debug-runner/animometer.css:
3149         * Animometer/resources/runner/animometer.css:
3150
3151         Update the structure of the harness. Remove the JSON-per-test but keep
3152         the JSON of the whole test run. Use the full page in order to display
3153         the graph.
3154
3155         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
3156         average, and worst 5% statistics.
3157         * Animometer/index.html: Make structure similar to developer.html.
3158         * Animometer/resources/debug-runner/animometer.css: Remove most of the
3159         button rules since they are superfluous. Move the progress bar to the
3160         top, fixed. Update the results page rules.
3161         * Animometer/resources/debug-runner/animometer.js: Remove most of the
3162         additions to sectionsManager since they are no longer needed.
3163         (setSectionHeader): Updates header of the section.
3164         (window.suitesManager._updateStartButtonState): Update selector.
3165         (showResults): Add keypress event for selecting different data for
3166         copy/paste. Update how the results are populated. Include full test
3167         JSON in a textarea, rather than requiring a button press.
3168         (showTestGraph):
3169         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
3170         title, and the text used as the cell contents, including class name.
3171         * Animometer/resources/extensions.js:
3172         (ResultsTable): Update to include a flattened version of the headers,
3173         used while populating table contents. Remove unneeded helper functions
3174         for creating the table. Rename "show" to "add".
3175         * Animometer/resources/runner/animometer.css: Update rules to
3176         accommodate the new structure.
3177         * Animometer/resources/runner/animometer.js:
3178         (window.sectionsManager.setSectionScore): Helper function to set the
3179         score and mean for a section.
3180         (window.sectionsManager.populateTable): Helper function to set the table.
3181         (window.benchmarkController.showResults): Refactor.
3182         (window.benchmarkController.selectResults): Update selectors.
3183         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
3184         extends it.
3185
3186         Update debug runner to have similar names to the basic runner. Include
3187         that page's CSS and remove extraneous CSS rules.
3188
3189         Get rid of the statistics table #record.
3190
3191         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
3192         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
3193         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
3194         (window.suitesManager._updateStartButtonState): Update selector to #intro.
3195         (setupRunningSectionStyle): Deleted.
3196
3197         * Animometer/resources/runner/animometer.css:
3198         (#test-container.selected): Change to flex-box only when visible.
3199
3200         Remove recordTable.
3201         * Animometer/resources/debug-runner/benchmark-runner.js:
3202         (BenchmarkRunner.prototype._runTestAndRecordResults):
3203         * Animometer/resources/runner/tests.js:
3204         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
3205         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
3206         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
3207         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
3208         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
3209         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
3210         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
3211         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
3212         * Animometer/tests/examples/resources/canvas-electrons.js:
3213         * Animometer/tests/examples/resources/canvas-stars.js:
3214         * Animometer/tests/misc/resources/compositing-transforms.js:
3215         * Animometer/tests/resources/main.js:
3216         * Animometer/tests/resources/stage.js:
3217         (StageBenchmark): Remove _recordTable.
3218         * Animometer/tests/simple/resources/simple-canvas-paths.js:
3219         * Animometer/tests/simple/resources/simple-canvas.js:
3220         * Animometer/tests/template/resources/template-canvas.js:
3221         * Animometer/tests/template/resources/template-css.js:
3222         * Animometer/tests/template/resources/template-svg.js:
3223         * Animometer/tests/text/resources/layering-text.js:
3224
3225         * Animometer/resources/debug-runner/animometer.js:
3226         (willStartFirstIteration): Fix selector, since results-table is used
3227         in multiple places, so it cannot be an id.
3228
3229         Make it possible to select the scores, or the whole table data,
3230         by cycling through different selections through key press of 's'.
3231
3232         * Animometer/resources/runner/animometer.js:
3233         (window.benchmarkController.showResults): Attach a keypress handler
3234         if it hasn't been added already.
3235         (window.benchmarkController.selectResults):
3236         * Animometer/resources/runner/tests.js: Cycle through different
3237         ranges.
3238
3239         Fix a few fly-by errors.
3240
3241         * Animometer/resources/debug-runner/benchmark-runner.js:
3242         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
3243         since the files are now in the top directory instead of inside runner/.
3244         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
3245         (BenchmarkRunner.prototype.step): Member variable is never used.
3246
3247         A little stylistic cleanup.
3248
3249         * Animometer/resources/debug-runner/benchmark-runner.js:
3250         * Animometer/resources/extensions.js:
3251         (window.DocumentExtension.createElement):
3252         * Animometer/tests/resources/main.js:
3253         (Benchmark.prototype.record):
3254         * Animometer/tests/resources/stage.js:
3255         (StageBenchmark.prototype.showResults): Reverse progress and message.
3256         The message appears less frequently than the progress.
3257         * Animometer/tests/simple/resources/simple-canvas.js:
3258         (SimpleCanvasBenchmark): Remove unused options.
3259
3260         Add newer version of harness in a new page. Consolidate differences between the two
3261         pages.
3262
3263         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
3264         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
3265         #test-container.
3266         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
3267         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
3268         instead of 4:3.
3269
3270         Split out benchmarkRunnerClient and benchmarkController.
3271
3272         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
3273         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
3274         and move populating the results table into benchmarkController. Rename _resultsDashboard
3275         to results and make it accessible for other objects to use.
3276         (willAddTestFrame): This is unnecessary. Remove.
3277
3278         (window.sectionsManager.showScore): Grab it from the results object instead of
3279         benchmarkRunnerClient.
3280         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
3281
3282         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
3283         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
3284         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
3285         here.
3286
3287         * Animometer/resources/debug-runner/benchmark-runner.js:
3288         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
3289         * Animometer/resources/extensions.js:
3290         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
3291         for later referencing.
3292         (ResultsDashboard.prototype.toJSON): Deleted.
3293         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
3294         outputting JSON. Store the processed data into a member variable that can be referenced later.
3295         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
3296         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
3297         aggregate score.
3298         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
3299         need for an empty children array. This was to allow for a header row in the table that spanned
3300         multiple columns. In the simpler harness, this is not needed.
3301         (ResultsTable.prototype._showEmptyCells):
3302         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
3303         which is the bare minimum needed for the simpler harness, key off of the header name provided.
3304         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
3305         split into the data and the headers, and are also displayed RTL so that a later patch allows a
3306         user to copy-paste the data easily.
3307         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
3308         The debug harness will extend these classes.
3309         (window.benchmarkController._startBenchmark): Used by both harnesses.
3310         (window.benchmarkController.startBenchmark): Set hard-coded options.
3311         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
3312         here.
3313
3314         Get rid of utilities.js. Move it all into extensions.js.
3315
3316         * Animometer/resources/extensions.js:
3317         * Animometer/tests/resources/utilities.js: Removed.
3318
3319         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
3320         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
3321         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
3322         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
3323         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
3324         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
3325         * Animometer/tests/examples/canvas-electrons.html: Ditto.
3326         * Animometer/tests/examples/canvas-stars.html: Ditto.
3327         * Animometer/tests/misc/compositing-transforms.html: Ditto.
3328         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
3329         * Animometer/tests/template/template-canvas.html: Ditto.
3330         * Animometer/tests/template/template-css.html: Ditto.
3331         * Animometer/tests/template/template-svg.html: Ditto.
3332         * Animometer/tests/text/layering-text.html: Ditto.
3333
3334         Split tests.js into two. Add a new suite to runner/tests.js.
3335
3336         * Animometer/developer.html: Update the script order. Scripts from
3337         debug-runner/ will always build on those from runner/, and have the
3338         same name.
3339         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
3340         suite into "miscellaneous tests".
3341         (Suite): Deleted.
3342         (Suite.prototype.prepare): Deleted.
3343         (Suite.prototype.run): Deleted.
3344         (suiteFromName): Deleted.