94440413f1c793aa359ae3fec51e33db8fecb09f
[WebKit-https.git] / PerformanceTests / ChangeLog
1 2016-02-06  Jon Lee  <jonlee@apple.com>
2
3         Update the JS includes due to ResultsTable move.
4
5         * Animometer/developer.html:
6         * Animometer/index.html:
7
8 2016-02-06  Jon Lee  <jonlee@apple.com>
9
10         Move createElement and createSVGElement to Utilities.
11
12         * Animometer/resources/extensions.js:
13         (Utilities.createElement): Added.
14         (Utilities.createSVGElement): Added.
15         (DocumentExtension.createElement): Deleted.
16         (DocumentExtension.createSvgElement): Deleted.
17
18         * Animometer/resources/debug-runner/animometer.js:
19         * Animometer/resources/runner/animometer.js:
20         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
21         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
22         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
23
24 2016-02-06  Jon Lee  <jonlee@apple.com>
25
26         Add a convenience function for creating a class.
27
28         The pattern for creating a class is common enough to add as a Utilities
29         helper function. It also makes it easy to collapse class definitions when
30         editing.
31
32         * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
33         since it is only used here.
34         * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
35         ResultsTable definition, since it is only used here.
36         * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
37         Point, Insets, SimplePromise.
38         (ProgressBar): Moved to animometer.js.
39         (ResultsDashboard): Moved to animometer.js.
40         (ResultsTable): Moved to animometer.js.
41         * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
42         BenchmarkRunner.
43         * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
44         * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
45
46         Convert test primitives.
47         * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
48         CanvasArc, CanvasLinePoint.
49         * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
50         CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
51         CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
52         CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
53         * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
54
55 2016-02-06  Jon Lee  <jonlee@apple.com>
56
57         Minor improvements to debug harness.
58
59         * Animometer/developer.html:
60         * Animometer/resources/debug-runner/animometer.css:
61         (#suites): Put the complexity text boxes closer to the test names.
62         (#options):
63         (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
64         (#intervalFPS path):
65         (#intervalFPS circle):
66         * Animometer/resources/debug-runner/animometer.js:
67         (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
68         (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
69         (window.suitesManager._createTestElement): Enhance such that typing into the complexity
70         input will automatically select that test for running.
71         (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
72         browsing.
73         * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
74         more accuracy in timestamps.
75
76 2016-02-06  Jon Lee  <jonlee@apple.com>
77
78         Refactor helper methods for getting random values for a stage.
79
80         Instead of requiring a Stage instance, just attach it to the Stage object.
81
82         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
83         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
84         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
85         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
86         * Animometer/tests/master/resources/canvas-tests.js:
87         * Animometer/tests/master/resources/particles.js:
88         * Animometer/tests/misc/resources/canvas-electrons.js:
89         * Animometer/tests/misc/resources/canvas-stars.js:
90         * Animometer/tests/misc/resources/compositing-transforms.js:
91         * Animometer/tests/resources/main.js:
92         * Animometer/tests/simple/resources/simple-canvas-paths.js:
93
94 2016-02-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
95
96         Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
97         https://bugs.webkit.org/show_bug.cgi?id=151716
98
99         Reviewed by Darin Adler.
100
101         The purpose of this test is to measure the performance of getImageData
102         and putImageData functions. This test draws a background on the canvas
103         and then gets some random tiles from this background and draw them in
104         destinations different from their original sources.
105
106         * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
107
108         * Animometer/resources/extensions.js:
109         (Array.prototype.shuffle): Shuffles the elements of an array.
110
111         (Point.zero): Returns a new Point object whose x and y are equal zero.
112         (Point.prototype.str): Used for debugging the Point object.
113
114         * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
115         (CanvasImageTile):
116         (CanvasImageTile.prototype.getImageData):
117         (CanvasImageTile.prototype.putImageData):
118         (Stage.call.initialize):
119         (Stage.call._createTiles):
120         (Stage.call._nextTilePosition):
121         (Stage.call.tune):
122         (Stage.call._drawBackground):
123         (Stage.call.animate):
124         (Stage.call.complexity):
125         (Stage.call):
126         * Animometer/tests/simple/tiled-canvas-image.html: Added.
127
128 2016-01-07  Jon Lee  <jonlee@apple.com>
129
130         Fix new test.
131
132         * Animometer/resources/runner/tests.js: Wrong URL from an
133         old patch.
134         * Animometer/tests/master/particles.html:
135         * Animometer/tests/master/resources/dom-particles.js:
136         (Particle.call.reset): Figured out a simpler way to set up
137         the particles.
138         (this.move.reset): Deleted.
139         (this.move._applyAttributes): Deleted.
140         * Animometer/tests/master/resources/particles.js:
141         (Particle): Call move() after reset().
142
143 2016-01-07  Jon Lee  <jonlee@apple.com>
144
145         Update benchmark test suite
146         https://bugs.webkit.org/show_bug.cgi?id=152679
147
148         Reviewed by Simon Fraser.
149
150         Add a new test. The test has a rotating background
151         gradient, and does a better job physically simulating
152         particles.
153
154         * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
155         (Point.prototype.length): Added.
156         (Point.prototype.normalize): Added.
157         * Animometer/resources/runner/tests.js: Add the test to the master suite.
158         * Animometer/tests/master/particles.html: Added.
159         * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
160         (Particle):
161         (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
162         reset it.
163         (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
164         (Particle.prototype.move): Subclasses should override.
165         (ParticlesStage): Stage includes a rotating gradient background.
166         * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
167         the stage.
168         * Animometer/tests/resources/star.svg: Added.
169
170 2016-01-03  Jon Lee  <jonlee@apple.com>
171
172         Update benchmark test suite
173         https://bugs.webkit.org/show_bug.cgi?id=152679
174
175         Reviewed by Simon Fraser.
176
177         Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
178
179         Needed by both harnesses.
180         * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
181         * Animometer/developer.html:
182         * Animometer/index.html:
183
184         Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
185         into extensions.js.
186         * Animometer/resources/extensions.js:
187         * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
188         * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
189         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
190         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
191         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
192         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
193         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
194         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
195         * Animometer/tests/master/canvas-stage.html:
196         * Animometer/tests/misc/canvas-electrons.html:
197         * Animometer/tests/misc/canvas-stars.html:
198         * Animometer/tests/misc/compositing-transforms.html:
199         * Animometer/tests/simple/simple-canvas-paths.html:
200         * Animometer/tests/template/template-canvas.html:
201         * Animometer/tests/template/template-css.html:
202         * Animometer/tests/template/template-svg.html:
203         * Animometer/tests/text/layering-text.html:
204         * Animometer/tests/text/text-boxes.html:
205
206 2016-01-07  Jon Lee  <jonlee@apple.com>
207
208         Update benchmark test suite
209         https://bugs.webkit.org/show_bug.cgi?id=152679
210
211         Reviewed by Simon Fraser.
212
213         Fix tests for other browsers.
214
215         * Animometer/resources/extensions.js:
216         (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
217         Use getBoundingClientRect() instead.
218         * Animometer/tests/misc/resources/canvas-electrons.js:
219         (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
220
221 2016-01-07  Jon Lee  <jonlee@apple.com>
222
223         Add a waitUntilReady() step
224         https://bugs.webkit.org/show_bug.cgi?id=152862
225
226         Reviewed by Simon Fraser.
227
228         Add a waitUntilReady() callback that lets the benchmark complete
229         its setup before running the benchmark.
230
231         * Animometer/tests/resources/main.js:
232         (Benchmark.prototype.run): First call waitUntilReady, which returns
233         a promise. When the promise resolves, run everything that was in this
234         function.
235         (Benchmark.prototype.waitUntilReady): Default implementation returns
236         a resolved promise.
237         (Benchmark.prototype.resolveWhenFinished): Deleted.
238         * Animometer/tests/template/resources/template-canvas.js:
239         (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
240
241 2016-01-03  Jon Lee  <jonlee@apple.com>
242
243         Update data reporting and analysis
244         https://bugs.webkit.org/show_bug.cgi?id=152670
245
246         Reviewed by Simon Fraser.
247
248         Show new graph data. Provide controls to show different series data. Provide an
249         interactive cursor that shows the data at a given sample.
250
251         * Animometer/developer.html: Add a nav section in #results. Each part of the graph
252         has a checkbox for visual toggling, as well as companion spans to contain the data.
253                 The numbers will always be shown even if the SVG isn't.
254         * Animometer/resources/debug-runner/animometer.css:
255         (#suites): Adjust spacing when doing fixed complexity.
256         (#test-graph nav): Place the nav in the upper right corner.
257         (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
258         that scale. Allow it to show.
259         (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
260         (#cursor line): The cursor contains a line and highlight circles for the data being shown.
261         (#cursor circle):
262         (#complexity path): This and rules afterward are named by series type.
263         (#complexity circle):
264         (#filteredFPS path):
265         (#filteredFPS circle):
266         (#rawFPS path):
267         (#intervalFPS circle):
268         (.left-samples): Deleted.
269         (.right-samples): Deleted.
270         * Animometer/resources/debug-runner/animometer.js:
271         (initialize): Add a "changed" listener when the checkboxes change in the nav.
272         (onBenchmarkOptionsChanged): Renamed.
273         (showTestGraph): All graph data is passed in as graphData instead of as arguments.
274         * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
275         a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
276         toggles the data on and off.
277         (updateGraphData): Add the axes. Add the average lines and markers for sample time and
278         target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
279         everything add a transparent area which will catch all of the mouse events. When the mouse
280         moves in the graph, find the closest data point, show the data in the nav area, and highlight
281         the data points.
282         (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
283         size a little larger than the circle radius for the data points.
284         (onGraphOptionsChanged): Called when data is visually toggled.
285         (showOrHideNodes): Helper function to toggle the .hidden class.
286         * Animometer/resources/extensions.js:
287         (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
288         (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
289
290         Producing the JSON can take a while with all of the data. Make it on-demand with a
291         button.
292
293         * Animometer/resources/debug-runner/animometer.js:
294         (showResults): When showing the results, don't serialize the JSON data. Move that to...
295         (showJSONResults): ...here. Remove the button.
296
297         * Animometer/developer.html: Add a button. The button will remove itself and populate
298         the textarea with the JSON data.
299         * Animometer/resources/debug-runner/animometer.css:
300         (.hidden): Add a universal hidden class.
301         (#results button.small-button): Promote the small-button styles to the whole results
302         section for use in the JSON button.
303         (#results button.small-button:active):
304         (#results-data button.small-button): Deleted.
305         (#results-data button.small-button:active): Deleted.
306
307         Refactor how Animator does its recording.
308
309         * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
310         the same interval frame rate for adjustment.
311         * Animometer/tests/resources/main.js:
312         (Animator): Remove _dropFrameCount, and make variables more accurate described.
313         (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
314         (Animator.prototype._intervalTimeDelta): Rename, only used internally.
315         (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
316         of the scene. If we are within the number of frames to measure for the interval, just
317         record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
318         the interval frame rate and the estimator's frame rate.
319
320         Avoid processing the data through the Experiment while the test is running. Reconfigure
321         the sampler to just record the raw samples. After the test is done, run the samples through
322         the Experiment to get the score.
323
324         * Animometer/resources/sampler.js:
325         (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
326         needed until the test concludes, so remove startSampling(). Clients should just call sample().
327         (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
328         of how many samples will be used. The processor is a called when it's time to process the data
329         since that is the client also telling the Sampler what to record.
330                 Introduce the notion of marks as well, which allows the client to mark when an
331         event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
332         it separately.
333         (Sampler.prototype.startSampling): Deleted. Clients should just call record().
334         (Sampler.prototype.record): The data to record is passed in as variable arguments.
335         (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
336         can provide extra data object for later retrieval.
337         (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
338         Call the processor to process the samples.
339         * Animometer/resources/debug-runner/benchmark-runner.js:
340         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
341
342         * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
343         not used.
344         * Animometer/tests/resources/main.js:
345         (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
346         number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
347         of the data being added to the Sampler. It is added through record(), and processed through
348         processSamples().
349         (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
350         the timestamp in the custom data for the mark. This avoids the need to store is separately in
351         the Sampler. Fold what was in record() here, since nothing else needs this functionality.
352         record() now just relays the information to the sampler.
353         (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
354         Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
355         (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
356                 Go through all of the samples. All samples contain a timestamp and complexity. We
357         calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
358         the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
359         experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
360         the experiments. Grab those scores and add them into results also.
361
362         Add complexity() to the tests for Benchmark.record().
363         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
364         * Animometer/tests/misc/resources/canvas-electrons.js:
365         * Animometer/tests/misc/resources/canvas-stars.js:
366         * Animometer/tests/text/resources/layering-text.js:
367
368 2015-12-27  Jon Lee  <jonlee@apple.com>
369
370         Simplify the test harness
371         https://bugs.webkit.org/show_bug.cgi?id=152562
372
373         Reviewed by Simon Fraser.
374
375         Update the simple canvas tests. For the paths, start from the center instead of the
376         top-left corner. Instead of using a coordinate limit, use a canonized factor, and
377         use that along both the x and y axes, so that more capable tests use more of the
378         canvas.
379
380         * Animometer/tests/simple/resources/simple-canvas-paths.js:
381         (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
382         (CanvasQuadraticPoint): Ditto.
383         (CanvasBezierPoint): Ditto.
384         * Animometer/tests/simple/resources/simple-canvas.js:
385         (tune): Calculate a factor instead of a maximum coordinate.
386
387 2015-12-27  Jon Lee  <jonlee@apple.com>
388
389         Simplify the test harness
390         https://bugs.webkit.org/show_bug.cgi?id=152562
391
392         Reviewed by Simon Fraser.
393
394         All of the benchmarks use the default Animator(). Don't require new tests
395         to pass a new instance, and instead just make one in the Benchmark constructor.
396
397         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
398         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
399         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
400         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
401         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
402         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
403         * Animometer/tests/master/resources/canvas-tests.js:
404         * Animometer/tests/misc/resources/canvas-electrons.js:
405         * Animometer/tests/misc/resources/canvas-stars.js:
406         * Animometer/tests/misc/resources/compositing-transforms.js:
407         * Animometer/tests/resources/main.js:
408         * Animometer/tests/simple/resources/simple-canvas-paths.js:
409         * Animometer/tests/template/resources/template-canvas.js:
410         * Animometer/tests/template/resources/template-css.js:
411         * Animometer/tests/template/resources/template-svg.js:
412         * Animometer/tests/text/resources/layering-text.js:
413         * Animometer/tests/text/resources/text-boxes.js:
414
415         Refactor the template.
416
417         * Animometer/tests/template/resources/template-canvas.js:
418         * Animometer/tests/template/resources/template-css.js:
419         * Animometer/tests/template/resources/template-svg.js:
420         * Animometer/tests/template/template-canvas.html:
421         * Animometer/tests/template/template-css.html:
422         * Animometer/tests/template/template-svg.html:
423
424         Refactor the SVG suite.
425
426         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
427         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
428
429         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
430         to stage.js.
431         * Animometer/tests/text/text-boxes.html: Ditto.
432
433         BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
434         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
435         BouncingCanvasParticlesBenchmark.
436         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
437         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
438
439         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
440         in the constructor instead of having subclasses set the private variable.
441
442         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
443         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
444
445         Refactor the HTML suite.
446
447         Move scripts to the end.
448         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
449         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
450         * Animometer/tests/text/layering-text.html:
451         * Animometer/tests/text/text-boxes.html:
452
453         Refactor to use the new variables.
454         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
455         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
456         * Animometer/tests/text/resources/layering-text.js:
457         * Animometer/tests/text/resources/text-boxes.js:
458
459         Refactor the bouncing canvas tests.
460
461         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
462         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
463
464         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
465         properties to "public" since they are used by subclasses.
466         (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
467         "public" for subclasses.
468         (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
469         * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
470
471         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
472         BouncingCanvasParticlesAnimator is no longer needed.
473         (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
474         having subclasses set the variable.
475
476         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
477         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
478
479         Move example/ files into misc/.
480
481         * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
482         * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
483         * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
484         * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
485
486         * Animometer/resources/debug-runner/tests.js: Update test URLs.
487
488         Refactor miscellaneous suite.
489
490         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
491         Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
492         not needed.
493         (tune): Remove console assert.
494         * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
495
496         * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
497         * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
498         * Animometer/tests/misc/resources/compositing-transforms.js:
499         * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
500         * Animometer/tests/examples/canvas-stars.html: Ditto.
501         * Animometer/tests/misc/compositing-transforms.html: Ditto.
502
503         Refactor the simple suite.
504
505         * Animometer/tests/master/resources/canvas-stage.js:
506         (tune): Remove coordinateMaximum since it is not needed in any
507         of the master tests.
508         * Animometer/tests/simple/resources/simple-canvas.js:
509         SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
510         needed.
511         (tune): Manage the objects differently, but instead of duplicating
512         all of SimpleCanvasStage here, just replace tune(). Include
513         coordinateMaximum, and remove items from the end of the list
514         instead of the beginning.
515         (StageBenchmark.call.createAnimator): Deleted.
516         (StageBenchmark.call): Deleted.
517         * Animometer/tests/simple/resources/simple-canvas-paths.js:
518         * Animometer/tests/simple/simple-canvas-paths.html: Move
519         scripts to the end.
520
521         Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
522
523         * Animometer/resources/debug-runner/animometer.js:
524         (initialize): Move the setting of testsCount to the debug runner.
525         (didRunTest): Nicer name.
526         * Animometer/resources/debug-runner/benchmark-runner.js:
527         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
528         * Animometer/resources/extensions.js:
529         (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
530         (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
531         * Animometer/resources/runner/animometer.js:
532         (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
533         * Animometer/resources/strings.js: These are no longer needed.
534         * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
535         * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
536         * Animometer/tests/resources/main.js: Messages are no longer needed
537         (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
538         indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
539         (BenchmarkState.prototype.currentStage): Deleted.
540         (BenchmarkState.prototype.currentMessage): Deleted.
541         (BenchmarkState.prototype.currentProgress): Deleted.
542         (Animator.prototype.animate): Deleted.
543         (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
544         (Benchmark.prototype.record): No need to update the progress bar.
545         * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
546
547         * Animometer/resources/debug-runner/benchmark-runner.js:
548         (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
549         Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
550         directly.
551
552         Make the class relationships more easily understandable. The benchmark owns the stage,
553         animator, and options. Make the stage and animator no longer have their own references to
554         the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
555         will try to get rid of stage.js altogether.
556         * Animometer/tests/resources/main.js:
557         (Stage): Moved from stage.js.
558         (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
559         by benchmark-related parameters in initialize().
560         (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
561         (Animator.prototype.get benchmark):
562         (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
563         the options dictionary.
564         (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
565         them.
566         (Benchmark.prototype.get options):
567         (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
568         (Benchmark.prototype.get animator):
569         (Benchmark.prototype.start):
570         (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
571         level of indirection.
572         (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
573         path, since tests can be individually selected, and remove the need for runBenchmark since that is
574         handled in BenchmarkRunner._runBenchmarkAndRecordResults.
575         * Animometer/tests/resources/stage.js:
576         (Stage): Deleted. Moved to main.js.
577         (StageBenchmark): What's left is updating the progress bar; to be removed.
578         (StageAnimator): What's left can be folded in Animator.
579
580         Refactor master suite.
581         * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
582         (animate): Push the clearRect() into each stage.
583         (complexity):
584         (StageBenchmark.call.createAnimator): Deleted.
585         (StageBenchmark.call): Deleted.
586         * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
587         (CanvasLineSegment.prototype.draw):
588         (CanvasArc):
589         (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
590         or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
591         function call. Do all of the drawing through the stage.
592
593         Refactor the subclass pattern. Introduce Utilities.createSubclass().
594
595         * Animometer/resources/debug-runner/benchmark-runner.js:
596         * Animometer/resources/extensions.js:
597         (window.Utilities.createSubclass): Takes the super class, a function representing
598         the class's constructor, and additional methods to attach to the new class's
599         prototype object.
600         * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
601
602         Refactor tests.
603         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
604         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
605         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
606         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
607         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
608         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
609         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
610         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
611         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
612         * Animometer/tests/examples/resources/canvas-electrons.js:
613         * Animometer/tests/examples/resources/canvas-stars.js:
614         * Animometer/tests/master/resources/canvas-stage.js:
615         * Animometer/tests/master/resources/canvas-tests.js:
616         * Animometer/tests/misc/resources/compositing-transforms.js:
617         * Animometer/tests/resources/stage.js:
618         * Animometer/tests/simple/resources/simple-canvas-paths.js:
619         * Animometer/tests/simple/resources/simple-canvas.js:
620         * Animometer/tests/template/resources/template-canvas.js:
621         * Animometer/tests/template/resources/template-css.js:
622         * Animometer/tests/template/resources/template-svg.js:
623         * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
624         and properties since they rely on each other.
625         * Animometer/tests/text/resources/text-boxes.js:
626
627         * Animometer/resources/debug-runner/animometer.js: Arrange calls
628         in the order they are evoked.
629         * Animometer/resources/debug-runner/benchmark-runner.js:
630         (BenchmarkRunnerState.prototype.next): Get rid of return value since
631         no caller to next() uses it.
632         (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
633         promise to resolve simply when onload() is called instead of
634         looking for #stage.
635         (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
636         simply calls runBenchmark(). Call it directly rather than through
637         the Suite.
638         (BenchmarkRunner.prototype.step): Remove unused parameter in
639         resolve callback.
640         (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
641         of self since it is outside of the closure which needed the self
642         variable.
643         (resolveIfReady): Deleted.
644         (BenchmarkRunner.prototype.waitForElement): Deleted.
645         * Animometer/resources/runner/tests.js: prepare() and run() are
646         no longer needed.
647         (Suite.prototype.prepare): Deleted.
648         (Suite.prototype.run): Deleted.
649         * Animometer/tests/master/canvas-stage.html: Move all scripts to
650         the end of the page.
651
652 2015-12-23  Simon Fraser  <simon.fraser@apple.com>
653
654         Add an Animometer developer test which animates text-rich boxes
655         https://bugs.webkit.org/show_bug.cgi?id=152544
656
657         Reviewed by Zalan Bujtas.
658
659         Add a test that draws lots of international text. This is a particle test,
660         moving the boxes around with absolution positioning.
661
662         * Animometer/resources/debug-runner/tests.js:
663         * Animometer/tests/text/resources/text-boxes.js: Added.
664         (BouncingTextBox):
665         (BouncingTextBox.prototype._move):
666         (BouncingTextBox.prototype.animate):
667         (BouncingTextBoxStage):
668         (BouncingTextBoxStage.prototype.createParticle):
669         (BouncingTextBoxStage.prototype.particleWillBeRemoved):
670         (BouncingTextBoxsBenchmark):
671         (BouncingTextBoxsBenchmark.prototype.createStage):
672         (window.benchmarkClient.create):
673         * Animometer/tests/text/text-boxes.html: Added.
674
675 2015-12-23  Jon Lee  <jonlee@apple.com>
676
677         Split benchmark into two different pages
678         https://bugs.webkit.org/show_bug.cgi?id=152458
679
680         Reviewed by Simon Fraser.
681
682         Add tests to 'animometer' suite.
683
684         * Animometer/resources/runner/tests.js:
685         * Animometer/tests/master/canvas-stage.html: Added.
686         * Animometer/tests/master/resources/canvas-stage.js: Added.
687         * Animometer/tests/master/resources/canvas-tests.js: Added.
688         * Animometer/tests/master/resources/stage.css: Added.
689
690 2015-12-23  Jon Lee  <jonlee@apple.com>
691
692         Split benchmark into two different pages
693         https://bugs.webkit.org/show_bug.cgi?id=152458
694
695         Reviewed by Simon Fraser.
696
697         Address comments.
698
699         * Animometer/resources/debug-runner/benchmark-runner.js:
700         (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
701         sampler goes away, and a later call to get the JSON data is no longer available. Process the data
702         right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
703         * Animometer/resources/extensions.js:
704         (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
705         (Array.prototype.find.Array.prototype.find): Update the null check.
706         (ResultsDashboard.prototype._processData): Use the already-processed data.
707         * Animometer/resources/runner/animometer.css:
708         (.frame-container > iframe): Remove calc().
709
710         Move Array functions to extensions.js since that is included by the harness.
711         Add ES6 Array polyfills.
712
713         * Animometer/resources/algorithm.js:
714         (Array.prototype.swap): Moved to extensions.js.
715         * Animometer/resources/extensions.js:
716         (Array.prototype.swap):
717         (Array.prototype.fill): Added.
718         (Array.prototype.find): Added.
719
720         Adjust styles for iPad.
721
722         * Animometer/resources/runner/animometer.css:
723         (@media screen and (min-device-width: 768px)): Apply to iPad as well.
724         (@media screen and (max-device-width: 1024px)): Update width for iPads.
725
726         Adjustment styles for iOS.
727
728         * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
729         update the style rules.
730         * Animometer/index.html:
731         * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
732         (@media screen and (min-device-width: 1800px)): Move this up.
733         * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
734
735         Get rid of prefixed flex properties for now.
736
737         * Animometer/resources/debug-runner/animometer.css:
738         * Animometer/resources/runner/animometer.css:
739
740         Update the structure of the harness. Remove the JSON-per-test but keep
741         the JSON of the whole test run. Use the full page in order to display
742         the graph.
743
744         * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
745         average, and worst 5% statistics.
746         * Animometer/index.html: Make structure similar to developer.html.
747         * Animometer/resources/debug-runner/animometer.css: Remove most of the
748         button rules since they are superfluous. Move the progress bar to the
749         top, fixed. Update the results page rules.
750         * Animometer/resources/debug-runner/animometer.js: Remove most of the
751         additions to sectionsManager since they are no longer needed.
752         (setSectionHeader): Updates header of the section.
753         (window.suitesManager._updateStartButtonState): Update selector.
754         (showResults): Add keypress event for selecting different data for
755         copy/paste. Update how the results are populated. Include full test
756         JSON in a textarea, rather than requiring a button press.
757         (showTestGraph):
758         * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
759         title, and the text used as the cell contents, including class name.
760         * Animometer/resources/extensions.js:
761         (ResultsTable): Update to include a flattened version of the headers,
762         used while populating table contents. Remove unneeded helper functions
763         for creating the table. Rename "show" to "add".
764         * Animometer/resources/runner/animometer.css: Update rules to
765         accommodate the new structure.
766         * Animometer/resources/runner/animometer.js:
767         (window.sectionsManager.setSectionScore): Helper function to set the
768         score and mean for a section.
769         (window.sectionsManager.populateTable): Helper function to set the table.
770         (window.benchmarkController.showResults): Refactor.
771         (window.benchmarkController.selectResults): Update selectors.
772         * Animometer/resources/runner/tests.js: Set Headers. Debug harness
773         extends it.
774
775         Update debug runner to have similar names to the basic runner. Include
776         that page's CSS and remove extraneous CSS rules.
777
778         Get rid of the statistics table #record.
779
780         * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
781         * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
782         * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
783         (window.suitesManager._updateStartButtonState): Update selector to #intro.
784         (setupRunningSectionStyle): Deleted.
785
786         * Animometer/resources/runner/animometer.css:
787         (#test-container.selected): Change to flex-box only when visible.
788
789         Remove recordTable.
790         * Animometer/resources/debug-runner/benchmark-runner.js:
791         (BenchmarkRunner.prototype._runTestAndRecordResults):
792         * Animometer/resources/runner/tests.js:
793         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
794         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
795         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
796         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
797         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
798         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
799         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
800         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
801         * Animometer/tests/examples/resources/canvas-electrons.js:
802         * Animometer/tests/examples/resources/canvas-stars.js:
803         * Animometer/tests/misc/resources/compositing-transforms.js:
804         * Animometer/tests/resources/main.js:
805         * Animometer/tests/resources/stage.js:
806         (StageBenchmark): Remove _recordTable.
807         * Animometer/tests/simple/resources/simple-canvas-paths.js:
808         * Animometer/tests/simple/resources/simple-canvas.js:
809         * Animometer/tests/template/resources/template-canvas.js:
810         * Animometer/tests/template/resources/template-css.js:
811         * Animometer/tests/template/resources/template-svg.js:
812         * Animometer/tests/text/resources/layering-text.js:
813
814         * Animometer/resources/debug-runner/animometer.js:
815         (willStartFirstIteration): Fix selector, since results-table is used
816         in multiple places, so it cannot be an id.
817
818         Make it possible to select the scores, or the whole table data,
819         by cycling through different selections through key press of 's'.
820
821         * Animometer/resources/runner/animometer.js:
822         (window.benchmarkController.showResults): Attach a keypress handler
823         if it hasn't been added already.
824         (window.benchmarkController.selectResults):
825         * Animometer/resources/runner/tests.js: Cycle through different
826         ranges.
827
828         Fix a few fly-by errors.
829
830         * Animometer/resources/debug-runner/benchmark-runner.js:
831         (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
832         since the files are now in the top directory instead of inside runner/.
833         (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
834         (BenchmarkRunner.prototype.step): Member variable is never used.
835
836         A little stylistic cleanup.
837
838         * Animometer/resources/debug-runner/benchmark-runner.js:
839         * Animometer/resources/extensions.js:
840         (window.DocumentExtension.createElement):
841         * Animometer/tests/resources/main.js:
842         (Benchmark.prototype.record):
843         * Animometer/tests/resources/stage.js:
844         (StageBenchmark.prototype.showResults): Reverse progress and message.
845         The message appears less frequently than the progress.
846         * Animometer/tests/simple/resources/simple-canvas.js:
847         (SimpleCanvasBenchmark): Remove unused options.
848
849         Add newer version of harness in a new page. Consolidate differences between the two
850         pages.
851
852         * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
853         to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
854         #test-container.
855         * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
856         * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
857         instead of 4:3.
858
859         Split out benchmarkRunnerClient and benchmarkController.
860
861         * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
862         benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
863         and move populating the results table into benchmarkController. Rename _resultsDashboard
864         to results and make it accessible for other objects to use.
865         (willAddTestFrame): This is unnecessary. Remove.
866
867         (window.sectionsManager.showScore): Grab it from the results object instead of
868         benchmarkRunnerClient.
869         (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
870
871         (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
872         (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
873         (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
874         here.
875
876         * Animometer/resources/debug-runner/benchmark-runner.js:
877         (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
878         * Animometer/resources/extensions.js:
879         (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
880         for later referencing.
881         (ResultsDashboard.prototype.toJSON): Deleted.
882         (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
883         outputting JSON. Store the processed data into a member variable that can be referenced later.
884         (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
885         (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
886         aggregate score.
887         (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
888         need for an empty children array. This was to allow for a header row in the table that spanned
889         multiple columns. In the simpler harness, this is not needed.
890         (ResultsTable.prototype._showEmptyCells):
891         (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
892         which is the bare minimum needed for the simpler harness, key off of the header name provided.
893         * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
894         split into the data and the headers, and are also displayed RTL so that a later patch allows a
895         user to copy-paste the data easily.
896         * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
897         The debug harness will extend these classes.
898         (window.benchmarkController._startBenchmark): Used by both harnesses.
899         (window.benchmarkController.startBenchmark): Set hard-coded options.
900         (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
901         here.
902
903         Get rid of utilities.js. Move it all into extensions.js.
904
905         * Animometer/resources/extensions.js:
906         * Animometer/tests/resources/utilities.js: Removed.
907
908         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
909         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
910         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
911         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
912         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
913         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
914         * Animometer/tests/examples/canvas-electrons.html: Ditto.
915         * Animometer/tests/examples/canvas-stars.html: Ditto.
916         * Animometer/tests/misc/compositing-transforms.html: Ditto.
917         * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
918         * Animometer/tests/template/template-canvas.html: Ditto.
919         * Animometer/tests/template/template-css.html: Ditto.
920         * Animometer/tests/template/template-svg.html: Ditto.
921         * Animometer/tests/text/layering-text.html: Ditto.
922
923         Split tests.js into two. Add a new suite to runner/tests.js.
924
925         * Animometer/developer.html: Update the script order. Scripts from
926         debug-runner/ will always build on those from runner/, and have the
927         same name.
928         * Animometer/resources/debug-runner/tests.js: Move "complex examples"
929         suite into "miscellaneous tests".
930         (Suite): Deleted.
931         (Suite.prototype.prepare): Deleted.
932         (Suite.prototype.run): Deleted.
933         (suiteFromName): Deleted.
934         * Animometer/resources/runner/tests.js: Added. Take definitions and
935         functions needed by the test harness. Leave the test suites behind.
936         (Suite): Moved from debug script.
937         (Suite.prototype.prepare): Ditto.
938         (Suite.prototype.run): Ditto.
939         (suiteFromName): Ditto.
940         (testFromName): Ditto.
941
942         Move benchmark resources out into resources/debug-runner, and update URLs.
943
944         * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
945         * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
946         * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
947         * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
948         * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
949         * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
950         * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
951
952 2015-12-11  Jon Lee  <jonlee@apple.com>
953
954         Improve Animometer on iOS
955         https://bugs.webkit.org/show_bug.cgi?id=152180
956
957         Reviewed by Simon Fraser.
958
959         Improve experience on phones. Make the canvas take
960         up the whole screen.
961
962         * Animometer/runner/animometer.html: Add meta viewport.
963         Remove the container div.
964         * Animometer/runner/resources/animometer.css: Have buttons lay
965         out vertically. Update detail arrow glyph. Make the suites and
966         options section lay out vertically. Remove the top spacers since
967         we want the canvas to take over the whole screen. Minimal display
968         is recommended for use.
969
970 2015-12-07  Jon Lee  <jonlee@apple.com>
971
972         Update suites for benchmark
973         https://bugs.webkit.org/show_bug.cgi?id=151957
974
975         Reviewed by Simon Fraser.
976
977         * Animometer/runner/animometer.html: Use spacers instead of relying on
978         justify-content center to center the content. That allows the opening screen
979         to grow downward when expanding the list of choices, otherwise it expands
980         from the center, and off the top edge of the screen.
981         * Animometer/runner/resources/animometer.css:
982         (.tree): Don't overflow scroll.
983         (.tree > li > label.tree-label:before): Use better glyphs.
984         (.tree > li > :checked ~ label.tree-label:before):
985         (main): Using flex-start for justify-content so that if the section grows too
986         big it gets pinned to the top edge of the document instead of growing past it.
987         (.spacer): Make the spacers have a minimum 20px and grow evenly.
988         (section#home): Add a min-height so that the border will expand if the suite
989         tests shown make the section grow past the height.
990         * Animometer/runner/resources/animometer.js: Update the selectors.
991         (window.suitesManager._treeElement):
992         (window.suitesManager._suitesElements):
993         (window.suitesManager._editsElements):
994
995 2015-12-07  Jon Lee  <jonlee@apple.com>
996
997         Update options for benchmark
998         https://bugs.webkit.org/show_bug.cgi?id=151956
999
1000         Reviewed by Simon Fraser.
1001
1002         Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
1003
1004         Move "Show running results" into a radio group, and add options to remove the HUD.
1005
1006         * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
1007         in a form for easier referencing in JS.
1008         * Animometer/runner/resources/animometer.css: Show the surrounding border if the
1009         body's display-minimal class name is set.
1010         * Animometer/runner/resources/animometer.js:
1011
1012         Update the way optionsManager gets and sets default values. Include support for
1013         radio groups.
1014         (window.optionsManager.valueForOption):
1015         (window.optionsManager.updateUIFromLocalStorage):
1016         (window.optionsManager.updateLocalStorageFromUI):
1017
1018         (window.benchmarkRunnerClient.willStartFirstIteration):
1019         (window.sectionsManager.setupRunningSectionStyle):
1020         (window.suitesManager._treeElement): Fly-by whitespace fix.
1021         (window.suitesManager._suitesElements): Ditto.
1022         (window.suitesManager.updateEditsElementsState): Update options check.
1023         (window.suitesManager.updateDisplay): Add a new update function for the HUD.
1024         Attach a class to the body depending on the user's choice.
1025         (window.benchmarkController.initialize): Add an event listener when the form
1026         radio buttons update.
1027         (window.benchmarkController.onFormChanged):
1028         (window.optionsManager._optionsElements): Deleted.
1029         (window.optionsManager._adaptiveTestElement): Deleted.
1030         (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
1031         * Animometer/tests/resources/main.js:
1032         (Benchmark.prototype.update): Update options checks.
1033         * Animometer/tests/resources/stage.js: Update option check.
1034         (StageBenchmark.prototype.showResults):
1035
1036 2015-12-01  Simon Fraser  <simon.fraser@apple.com>
1037
1038         Add a basic compositing Animometer test
1039         https://bugs.webkit.org/show_bug.cgi?id=151724
1040
1041         Reviewed by Dean Jackson.
1042
1043         Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
1044
1045         This is added under a new "Miscellaneous" category.
1046
1047         Remove the test templates category from the UI.
1048
1049         * Animometer/runner/resources/tests.js:
1050         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1051         (BouncingCssShape.prototype.animate):
1052         * Animometer/tests/misc/compositing-transforms.html: Added.
1053         * Animometer/tests/misc/resources/compositing-transforms.js: Added.
1054         (BouncingCompositedImage):
1055         (BouncingCompositedImage.prototype._move):
1056         (BouncingCompositedImage.prototype.animate):
1057         (CompositingTransformsStage):
1058         (CompositingTransformsStage.prototype.createParticle):
1059         (CompositingTransformsStage.prototype.particleWillBeRemoved):
1060         (CompositedTransformsBenchmark):
1061         (CompositedTransformsBenchmark.prototype.createStage):
1062         (window.benchmarkClient.create):
1063
1064 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1065
1066         Fix the graphics benchmark complexity bounds adjustment
1067         https://bugs.webkit.org/show_bug.cgi?id=151670
1068
1069         Reviewed by Simon Fraser.
1070
1071         Make sure the graphics benchmark complexity bounds adjustment is applied
1072         to the absolute lower bound.
1073
1074         * Animometer/tests/resources/math.js:
1075         (PIDController.prototype._saturate):
1076
1077 2015-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
1078
1079         Add an option to select the results form the graphics benchmark
1080         https://bugs.webkit.org/show_bug.cgi?id=151666
1081
1082         Reviewed by Ryosuke Niwa.
1083
1084         We need an easy way to select the graphics benchmark results table such
1085         that when it is copied to the clipboard, rich text format is set to the
1086         clipboard.
1087
1088         * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
1089
1090         * Animometer/runner/resources/animometer.js:
1091         (window.sectionsManager._sectionDataElement): Selects the container <data> element.
1092         (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
1093         (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
1094         (window.sectionsManager.selectData): Selects the container <data> element in a selection.
1095         (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
1096         (window.benchmarkController.selectResults): Selects the results table.
1097         (window.benchmarkController.showJSON): Function rename.
1098         (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
1099         (window.benchmarkController.showJson): Deleted.
1100
1101 2015-11-20  Simon Fraser  <simon.fraser@apple.com>
1102
1103         Animometer: graphs should not do interpolation
1104         https://bugs.webkit.org/show_bug.cgi?id=151526
1105
1106         Reviewed by Simon Fraser.
1107
1108         Having the graphs do interpolation is misleading, because you can't see the actual data.
1109
1110         Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
1111
1112         * Animometer/runner/resources/animometer.css:
1113         (section#test-graph > data > svg): Deleted.
1114         * Animometer/runner/resources/graph.js:
1115         (graph): Deleted.
1116
1117 2015-11-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
1118
1119         Calculate the graphics benchmark test gain adaptively
1120         https://bugs.webkit.org/show_bug.cgi?id=151208
1121
1122         Reviewed by Darin Adler.
1123
1124         We need to calculate the gain of the graphics benchmark tests adaptively
1125         and get rid of the gain and limits parameters we have to choose manually
1126         for every test. We are going to use the classic Ziegler–Nichols method for
1127         calculating the gain and integral and derivative times. We are going to
1128         try moving on a cubic curve during the manual stage from y0 to reach ysp.
1129         We also going to use a saturation actuator to ensure the system does not
1130         fluctuate.
1131
1132         * Animometer/resources/extensions.js:
1133         (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
1134         (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
1135         (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
1136
1137         * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
1138
1139         * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
1140
1141         * Animometer/tests/resources/main.js:
1142         (BenchmarkState.prototype.currentStage): Fix an enum name.
1143         (Benchmark): Get rid of manual gain and limits.
1144         (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
1145
1146         * Animometer/tests/resources/math.js:
1147         (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
1148         (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
1149         (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
1150         (PIDController.prototype._distance): Calculates the distance of y relative to y0.
1151         (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
1152         (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
1153         (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
1154         (PIDController.prototype._tunePID): PID tuning function.
1155         (PIDController.prototype._tune):
1156         (PIDController.prototype._saturate):
1157         (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
1158         (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
1159
1160 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1161
1162         Reorganize the graphics benchmark string table
1163         https://bugs.webkit.org/show_bug.cgi?id=151334
1164
1165         Reviewed by Simon Fraser.
1166
1167         Make the graphics benchmark string table be an object of sub-objects. Each
1168         sub-object represents an associative array, the key is the string name and
1169         the value is the string data.
1170
1171         * Animometer/resources/extensions.js:
1172         (ResultsDashboard.prototype.toJSON):
1173         (ResultsTable.prototype._showGraph):
1174         (ResultsTable.prototype._showJSON):
1175         (ResultsTable.prototype._isNoisyMeasurement):
1176         (ResultsTable.prototype._isNoisyTest):
1177         (ResultsTable.prototype._showTest):
1178         (ResultsTable.prototype._showSuite):
1179         (ResultsTable.prototype._showIteration):
1180         * Animometer/resources/sampler.js:
1181         (Sampler.prototype.toJSON):
1182         * Animometer/resources/strings.js:
1183         * Animometer/runner/resources/animometer.js:
1184         (window.benchmarkRunnerClient.didFinishLastIteration):
1185         (window.suitesManager.updateLocalStorageFromJSON):
1186         (window.benchmarkController.showResults):
1187         (window.benchmarkController.showJson):
1188         (window.benchmarkController.showTestGraph):
1189         (window.benchmarkController.showTestJSON):
1190         * Animometer/runner/resources/tests.js:
1191         * Animometer/tests/resources/main.js:
1192
1193 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1194
1195         Disable flattening the stage iframe of the graphics benchmark when running on iOS
1196         https://bugs.webkit.org/show_bug.cgi?id=151361
1197
1198         Reviewed by Simon Fraser.
1199
1200         Use fixed size for stage iframe of the graphics benchmark to disable
1201         flattening the iframe while animating the particles. Also ensure the
1202         bouncing particles do not go outside the iframe's boundaries.
1203
1204         * Animometer/runner/resources/animometer.css:
1205         (section#running > #running-test > iframe):
1206         (@media screen and (min-device-width: 1800px)):
1207         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1208         (BouncingParticle.prototype.animate):
1209
1210 2015-11-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
1211
1212         Use the media queries to dynamically set the stage for the graphics benchmark
1213         https://bugs.webkit.org/show_bug.cgi?id=151327
1214
1215         Reviewed by Simon Fraser.
1216
1217         Clean setting the benchmark css rules by using the media queries. Accessing
1218         document.stylesheets.cssRules seems to be unreliable. Fix the test harness
1219         load event listener invocation. And also remove the options for normalizing
1220         the stage resolution for retina display.
1221
1222         * Animometer/resources/extensions.js:
1223         (window.DocumentExtension.insertCssRuleAfter): Deleted.
1224         * Animometer/runner/animometer.html:
1225         * Animometer/runner/resources/animometer.css:
1226         (@media screen and (min-device-width: 1800px)):
1227         * Animometer/runner/resources/animometer.js:
1228         (window.sectionsManager.setupRunningSectionStyle):
1229         (window.benchmarkController.initialize):
1230         (window.sectionsManager.setupSectionStyle): Deleted.
1231         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1232         (BouncingParticlesStage):
1233         * Animometer/tests/text/layering-text.html:
1234         * Animometer/tests/text/resources/layering-text.js:
1235         (LayeringTextStage):
1236         (LayeringTextStage.prototype._setFontSize): Deleted.
1237
1238 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1239
1240         Remove the option for animating using setInterval from the graphics benchmark
1241         https://bugs.webkit.org/show_bug.cgi?id=151283
1242
1243         Reviewed by Darin Adler.
1244
1245         Get rid of the option to run animation using setInterval().
1246
1247         * Animometer/tests/resources/main.js:
1248         (Animator.prototype.animate):
1249         (Benchmark):
1250         (Benchmark.prototype.start):
1251         (Animator.prototype.start): Deleted.
1252
1253 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1254
1255         Highlight the alarming test results in the graphics benchmark results page
1256         https://bugs.webkit.org/show_bug.cgi?id=151286
1257
1258         Reviewed by Simon Fraser.
1259
1260         When showing the results of a test in the graphics benchmark the following
1261         criteria is going to be applied:
1262
1263         1. If the standard deviation of the test complexity or the frame rate is
1264            equal to or more than 10%, the standard deviation and the test name
1265            will be displayed in red.
1266         2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
1267            .. (desired_frame_rate + 2)], the average frame rate and the test name will
1268            be displayed in red.
1269
1270         * Animometer/resources/extensions.js:
1271         (ResultsTable.prototype._showHeaderRow):
1272         (ResultsTable.prototype._showHeader):
1273         (ResultsTable.prototype._showEmptyCell):
1274         (ResultsTable.prototype._showText):
1275         (ResultsTable.prototype._showFixedNumber):
1276         (ResultsTable.prototype.):
1277         (ResultsTable.prototype._showGraph):
1278         (ResultsTable.prototype._showJSON):
1279         (ResultsTable.prototype._isAlarmingMeasurement):
1280         (ResultsTable.prototype._isAlarmingTestResults):
1281         (ResultsTable.prototype._showEmptyCells):
1282         (ResultsTable.prototype._showEmptyRow):
1283         (ResultsTable.prototype._showTest):
1284         (ResultsTable.prototype._showSuite):
1285         (ResultsTable.prototype._showIteration):
1286         (ResultsTable.prototype.showRecord):
1287         (ResultsTable.prototype.showIterations):
1288         (ResultsTable.prototype._showEmpty): Deleted.
1289         * Animometer/runner/resources/animometer.js:
1290         (window.benchmarkRunnerClient.didFinishLastIteration):
1291         * Animometer/tests/resources/stage.js:
1292         (StageBenchmark.prototype.showResults):
1293
1294 2015-11-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
1295
1296         Clean referencing the options object in the graphics benchmark
1297         https://bugs.webkit.org/show_bug.cgi?id=151284
1298
1299         Reviewed by Simon Fraser.
1300
1301         Get rid of the Benchmark.options member and rely only on the private member
1302         Benchmark._options. The animator need to have its own options member instead
1303         of accessing it from its reference to Benchmark object.
1304
1305         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1306         (BouncingCanvasParticlesAnimator):
1307         (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
1308         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1309         (BouncingParticle.prototype.animate):
1310         (BouncingParticlesAnimator):
1311         (BouncingParticlesBenchmark.prototype.createAnimator):
1312         * Animometer/tests/examples/resources/canvas-electrons.js:
1313         (CanvasElectronsStage.prototype.animate):
1314         (CanvasElectronsAnimator):
1315         (CanvasElectronsBenchmark.prototype.createAnimator):
1316         (window.benchmarkClient.create):
1317         * Animometer/tests/examples/resources/canvas-stars.js:
1318         (CanvasStarsStage.prototype.animate):
1319         (CanvasStarsAnimator):
1320         (CanvasStarsBenchmark.prototype.createAnimator):
1321         (window.benchmarkClient.create):
1322         * Animometer/tests/resources/main.js:
1323         (BenchmarkState.prototype.currentProgress):
1324         (Animator):
1325         (Animator.prototype.animate):
1326         (Benchmark):
1327         (Benchmark.prototype.update):
1328         * Animometer/tests/resources/stage.js:
1329         (Stage.prototype.clear):
1330         (StageAnimator):
1331         (StageBenchmark.prototype.createAnimator):
1332         (StageBenchmark.prototype.tune):
1333         (StageBenchmark.prototype.showResults):
1334         * Animometer/tests/simple/resources/simple-canvas.js:
1335         (SimpleCanvasStage.prototype.animate):
1336         (SimpleCanvasAnimator):
1337         (SimpleCanvasAnimator.prototype.animate):
1338         (SimpleCanvasBenchmark.prototype.createAnimator):
1339         * Animometer/tests/template/resources/template-canvas.js:
1340         (TemplateCanvasStage.prototype.animate):
1341         (TemplateCanvasBenchmark.prototype.createAnimator):
1342         (window.benchmarkClient.create):
1343
1344 2015-11-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1345
1346         Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
1347         https://bugs.webkit.org/show_bug.cgi?id=151289
1348
1349         Reviewed by Simon Fraser.
1350
1351         Cache the stage size when it is created instead of requesting every time
1352         an object is added via clientWidth and clientHeight.
1353
1354         * Animometer/resources/extensions.js:
1355         (Insets.elementPadding):
1356         * Animometer/tests/resources/stage.js:
1357         (Stage):
1358         (Stage.prototype.get size):
1359
1360 2015-11-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
1361
1362         Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
1363         https://bugs.webkit.org/show_bug.cgi?id=150965
1364
1365         Reviewed by Darin Adler.
1366
1367         This should give the benchmark more accurate reading at warmup time. And
1368         hence we can safely reduce the test running time to be 10 seconds.
1369
1370         * Animometer/runner/animometer.html:
1371         Add "defer" back when loading resources/animometer.js since this script
1372         depends on many other scripts and we need to wait till the page is parsed.
1373         Also change the default test interval to be 10 seconds.
1374
1375         * Animometer/runner/resources/graph.js:
1376         (graph): Make the test results curves smoother.
1377
1378         * Animometer/tests/resources/main.js:
1379         (Animator): Initialize the Kalman filter with 60 FPS which should be true
1380         if the test page is empty.
1381
1382         (Animator.prototype.animate):
1383         * Animometer/tests/resources/math.js:
1384         (KalmanEstimator): Fix the initial value of _vecX_est.
1385             _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
1386             _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
1387             _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
1388         (KalmanEstimator.prototype.estimate): Add some comments.
1389
1390 2015-11-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1391
1392         Remove "defer" from the scripts' references in the graphics benchmark home page
1393         https://bugs.webkit.org/show_bug.cgi?id=150915
1394
1395         Reviewed by Simon Fraser.
1396
1397         It causes the benchmark to be very flakey.
1398
1399         * Animometer/runner/animometer.html:
1400
1401 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
1402
1403         Add an option to make the graphics benchmark runs a specific test with fixed complexity
1404         https://bugs.webkit.org/show_bug.cgi?id=150529
1405
1406         Reviewed by Darin Adler.
1407
1408         Beside each test in the suites tree, we are going to show the complexity
1409         arithmetic mean of the of the last run in an edit control. Based on a
1410         new option these edit controls will all be visible or hidden. If they are
1411         visible their values can be changed. The benchmark runner if it run in
1412         the non-adaptive mode will set the complexity of the test to the passed
1413         value and will not change it ever. The animator will animate the test and
1414         frame rate will also be measured.
1415
1416         * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
1417
1418         * Animometer/runner/resources/animometer.css:
1419         (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
1420         (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
1421         (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
1422         (section#home > options > label > input[type="number"]): Deleted.
1423
1424         * Animometer/runner/resources/animometer.js:
1425         (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
1426         (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
1427         (window.suitesManager._editElement):  Returns the edit element associated with each test element in the suites tree.
1428         (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
1429         (window.suitesManager._localStorageNameForTest): Change this function to take strings.
1430         (window.suitesManager._createTestElement): Adds an edit control beside each test.
1431         (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
1432         (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
1433         (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
1434         (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
1435         (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
1436         (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
1437
1438         * Animometer/tests/resources/main.js:
1439         (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
1440         (window.runBenchmark): Add the test complexity as a new benchmark option.
1441
1442 2015-11-01  Said Abou-Hallawa  <sabouhallawa@apple,com>
1443
1444         Make the size of the benchmark canvas adaptive to the screen size and screen resolution
1445         https://bugs.webkit.org/show_bug.cgi?id=150530
1446
1447         Reviewed by Darin Adler.
1448
1449         We want to set the size of the benchmark stage dynamically such that it
1450         depends on the screen resolution and the device scale factor. This patch
1451         does more than that because the home page css was not done properly. To
1452         use the flex box layout, the animometer.css has to be rewritten almost from
1453         scratch. The suites tree has to be rewritten also because it was not collapsing
1454         and with the flex box layout it was going outside of the window area. The
1455         options handling and the local storage handling had to be rewritten to
1456         allow more flexibility with this patch and the future patches. The code
1457         in animometer.js was reorganized into objects to allow distributing the code
1458         nicely among separate entities.
1459
1460         * Animometer/resources/extensions.js:
1461         (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
1462         (Insets.prototype.get width): Follow the function opening brace style guidelines.
1463         (Insets.prototype.get height):
1464         (Insets.prototype.get size): Returns the size of an Insets as a Point object.
1465
1466         (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
1467         (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
1468         (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
1469         (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
1470
1471         (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
1472         (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
1473         (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
1474         (Options): Deleted.
1475
1476         * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
1477
1478         * Animometer/runner/resources/animometer.css:
1479         (html,body):
1480         (button):
1481
1482         (button.large-button):The large button appears in the animometer.html.
1483         (button.large-button:active):
1484         (button.large-button:disabled):
1485
1486         (button.small-button): The small button appears in the results table.
1487         (button.small-button:active):
1488
1489         (.tree): The tree class is used to list the suites and their tests.
1490         (.tree .expand-button): This button expands a tree element.
1491         (.tree .expand-button ~ ul): Hide the children (<ul>...</ul>) of a parent node by default.
1492         (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked.
1493         (.tree ul): Hide the list bullets.
1494         (.tree li): Indent every node in the tree relative to its parent.
1495         (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case).
1496         (.tree > li:last-child): Do not indent the bottom of the last child node.
1497         (.tree-label): Style for all the labels in the tree.
1498         (label.tree-label): Style for the labels in the top level only (the suites nodes in our case).
1499         (label.tree-label:before): Style the unchecked case of the expand-button.
1500         (:checked ~ label.tree-label:before): Style the checked case of the expand-button.
1501
1502         (table.results-table): The results table appears while running the test and at the end.
1503         (.results-table td):
1504         (.results-table th):
1505
1506         (div.results-json): The JSON div appears per test or for the whole run.
1507
1508         (main): This is the flex box container.
1509
1510         (section): A section is displayed exclusively inside the <main>. It is hidden by default.
1511         (section.selected): When it is selected, its layout is flex layout.
1512         (section > footer): The header or the footer of a section should not take more than 15% of the container.
1513
1514         (section#home): The home section has <suites> and <options> parts to be laid out in the middle.
1515         (section#home > options):
1516         (section#home > suites): The <suites> should not take more than 40% of the width.
1517         (section#home > options > label): The benchmark title.
1518         (section#home > header > h2): The benchmark title.
1519         (section#home > options > label > input[type="number"]): Sets the width of the option edit control.
1520
1521         (section#running): The running section contain the runner <iframe> which takes the whole area of the <main>.
1522         (section#running > #running-test): This is the <iframe> container.
1523         (section#running > #running-test > iframe): The <iframe> is created by the runner for each test.
1524         (section#running > #progress): This is the progress bar.
1525         (section#running > #progress > #progress-completed): This is another element which grows while the runner is progressing.
1526         (section#running > #record): This the container of the record results table which is shown while running a test.
1527
1528         (section#results):
1529         (section#json):
1530         (section#test-json):
1531         (section#test-graph): All these sections have the same layout. A <data> element is laid out between <header> and <footer>.
1532
1533         (section#results > data):
1534         (section#json > data):
1535         (section#test-json > data):
1536         (section#test-graph > data): The <data> element should take 70% of the <section>.
1537
1538         (section#test-graph > data > svg):
1539         (.axis line):
1540         (.left-samples): These styles are for the d3 graph.
1541
1542         (section#test-json > data): This is the style of the JSON <data> element.
1543
1544         (iframe): Deleted.
1545         (label, p): Deleted.
1546         (section > p): Deleted.
1547         (section#home > p): Deleted.
1548         (section#home > p:first-child): Deleted.
1549         (#testContainer): Deleted.
1550         (section#running #progress-completed): Deleted.
1551         (section#results > table): Deleted.
1552         (section#results > table td, th): Deleted.
1553         (section#results > table tr.alt, td): Deleted.
1554         (section#results > table th): Deleted.
1555         (section#json > textarea): Deleted.
1556         (.options): Deleted.
1557         (.options p): Deleted.
1558         (#suites ul): Deleted.
1559         (#suites ul ul): Deleted.
1560         (#suites ul ul input, #suites ul ul label): Deleted.
1561         (#suites.showTests ul ul): Deleted.
1562         (.column): Deleted.
1563         (input[type="number"]): Deleted.
1564         (.buttons): Deleted.
1565         (.small-button): Deleted.
1566         (#graphContainer): Deleted.
1567         (.right-samples): Deleted.
1568         (.sample-time): Deleted.
1569         (.left-mean): Deleted.
1570         (.right-mean): Deleted.
1571
1572         * Animometer/runner/resources/animometer.js:
1573         (window.benchmarkRunnerClient.initialize): Initialize the client object with the options and the suites.
1574         (window.benchmarkRunnerClient.willStartFirstIteration): Use new css selectors for results and the record table.
1575         (window.benchmarkRunnerClient.didFinishLastIteration): Move the code which sets the JSON text to sectionsManager.showJSON().
1576
1577         (window.sectionsManager): Responsible of managing the <section>s elements inside animometer.html.
1578         (window.sectionsManager._sectionHeaderH1Element): Return the <h1> inside the <header> of a given section.
1579         (window.sectionsManager._sectionDataDivElement): Return the <div> inside the <data> of a given section.
1580         (window.sectionsManager.showScore): Show the score of the last benchmark run.
1581         (window.sectionsManager.showTestName): Show the test name for detailed results <section>.
1582         (window.sectionsManager.showJSON): Shows the JSON text of the last benchmark or for a specific test.
1583         (window.sectionsManager.showSection): Shows a specific <section> in the <main> container.
1584         (window.sectionsManager.setupSectionStyle): Sets css attributes for all the <section>s.
1585         (window.sectionsManager.setupRunningSectionStyle): Sets the css attributes for the running <section> only.
1586
1587         (window.optionsManager): Responsible of managing the user options and streaming them to/form the localStorage.
1588         (window.optionsManager._optionsElements): Returns the children <input> elements of the <options>.
1589         (window.optionsManager.updateUIFromLocalStorage): Restore the values of the <options> UI elements from the local storage.
1590         (window.optionsManager.updateLocalStorageFromUI): Saves the values of the <options> UI elements to the local storage.
1591
1592         (window.suitesManager): Responsible of managing the user suites and streaming them to/form the localStorage.
1593         (window.suitesManager._treeElement): Returns the suites tree container element.
1594         (window.suitesManager._suitesElements): Returns a list of the suites elements.
1595         (window.suitesManager._checkboxElement): Returns the checkbox element of a given suite.
1596         (window.suitesManager._localStorageNameForTest): Generates a string for the tuple <suite, test> to be saved in the localStorage.
1597         (window.suitesManager._updateSuiteCheckboxState): Updates the state of a suite checkbox from the state of its tests' checkboxes.
1598         (window.suitesManager._updateStartButtonState): Updates the state of the start button from the state of the suites' checkboxes.
1599         (window.suitesManager._onChangeSuiteCheckbox): Called when a suite checkbox is clicked.
1600         (window.suitesManager._onChangeTestCheckbox): Called when a test checkbox is clicked.
1601         (window.suitesManager._createSuiteElement): Creates suite node in the suites tree.
1602         (window.suitesManager._createTestElement): Creates test node in the suites tree.
1603         (window.suitesManager.createElements): Creates the suites tree dynamically from the array Suites.
1604         (window.suitesManager.updateUIFromLocalStorage): Restore the values of the <suites> UI elements from the local storage.
1605         (window.suitesManager.updateLocalStorageFromUI): aves the values of the <suites> UI elements to the local storage.
1606
1607         (window.benchmarkController): This is the UI controller of the animometer.html page.
1608         (window.benchmarkController.initialize): Called when the animometer.html page is loaded.
1609         (window.benchmarkController._runBenchmark): Starts a benchmark run.
1610         (window.benchmarkController.startTest): Called when the "Start Test" button is clicked.
1611         (window.benchmarkController.showResults): Called at the end of the test to show the final results.
1612         (window.benchmarkController.showJson): Called from the results page to show the JSON of the last benchmark run.
1613         (window.benchmarkController.showTestGraph): Called from the results the table to show a graph for the samples of a specific test.
1614         (window.benchmarkController.showTestJSON): Called from the results the table to show a JSON for the samples of a specific test.
1615
1616         (showSection): Deleted.
1617         (startTest): Deleted.
1618         (showResults): Deleted.
1619         (showJson): Deleted.
1620         (showTestGraph): Deleted.
1621         (showTestJSON): Deleted.
1622         (initialize.toggleTestsCheckbox.onchange): Deleted.
1623         (initialize): Deleted.
1624         (updateSuiteSelection): Deleted.
1625         (updateTestSelection): Deleted.
1626         (updateSuiteCheckbox): Deleted.
1627         (localStorageNameForTest): Deleted.
1628         (populateSettings.): Deleted.
1629         (populateSettings): Deleted.
1630
1631         * Animometer/runner/resources/benchmark-runner.js:
1632         (BenchmarkRunner): Pass the frameContainer element to the BenchmarkRunner.
1633         (BenchmarkRunner.prototype._appendFrame): Remove unused parameter unwanted styling code.
1634         (BenchmarkRunner.prototype.runMultipleIterations):  Use the this._client.iterationCount instead of passing it as a parameter also.
1635
1636         * Animometer/runner/resources/graph.js:
1637         (graph): Calculate the size of the chart from the container element.
1638
1639         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1640         (BouncingSvgImage):
1641         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1642         (BouncingSvgParticlesStage.prototype._createDefs):
1643         (BouncingSvgParticlesStage.prototype._createClipStar):
1644         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1645         (BouncingSvgShape.prototype._createShape):
1646         (BouncingSvgShapesStage.prototype.createGradient):
1647         Call DocumentExtension.createSvgElement() instead of calling Utilities.createSvgElement().
1648
1649         * Animometer/tests/resources/main.js:
1650         (Animator.prototype.animate):
1651         (Benchmark):
1652         (Benchmark.prototype.update):
1653         * Animometer/tests/resources/stage.js:
1654         (StageBenchmark.prototype.showResults):
1655         Rename the options to match the <input> ids in animometer.html.
1656
1657         * Animometer/tests/resources/utilities.js:
1658         (window.Utilities.createSvgElement): Deleted.
1659
1660         * Animometer/tests/text/layering-text.html:
1661         * Animometer/tests/text/resources/layering-text.js:
1662         (LayeringTextStage):
1663         (LayeringTextStage.prototype._setFontSize): Sets the size of the text dynamically such that they all fit in one stage.
1664
1665 2015-10-29  Simon Fraser  <simon.fraser@apple.com>
1666
1667         Animometer computes frame rate incorrectly
1668         https://bugs.webkit.org/show_bug.cgi?id=150698
1669
1670         Reviewed by Tim Horton.
1671
1672         The existing code incremented this._frameCount after checking against this._dropFrameCount.
1673         This has the effect of setting this._measureTimeOffset one frame too late, so
1674         we were measuring only two frames, not three, and thus computing an incorrect fps.
1675
1676         * Animometer/tests/resources/main.js:
1677         (Animator.prototype.animate):
1678
1679 2015-10-27  Jon Lee  <jonlee@apple.com>
1680
1681         Add an option to make the graphics benchmark runs a specific test
1682         https://bugs.webkit.org/show_bug.cgi?id=150528
1683         rdar://problem/23246614
1684
1685         Reviewed by Zalan Bujtas.
1686
1687         Add a checkbox that lets the user list all of the available tests, and select
1688         the ones to run repeatedly. The test checkboxes will update the state of the suite
1689         checkbox. The selected tests are stored in localStorage to make it easy to do
1690         repeated runs.
1691
1692         * Animometer/runner/animometer.html: Add a checkbox to show individual tests.
1693         Update other markup.
1694         * Animometer/runner/resources/animometer.css: Make the settings area a little wider
1695         to accommodate the longer names of the tests
1696         * Animometer/runner/resources/animometer.js:
1697         (startBenchmark): Change the way that the suites are fed into the benchmark
1698         runner. Go through each of the suites and their tests, and create a new Suite
1699         with just the enabled tests. While enumerating store the enabled tests into
1700         localStorage.
1701         (initialize): Initialization routine (taking over populateSettings). When the
1702         checkbox for showing tests is toggled, add or remove a class on #suites to show
1703         the individual tests.
1704         (updateSuiteSelection): Called whenever the user toggles the checkbox for a suite.
1705         Either select all or none of the tests.
1706         (updateTestSelection): Called whenever the user toggles the checkbox for a test.
1707         (updateSuiteCheckbox): Update the state of the test's suite's checkbox to
1708         indeterminate if there is at least one enabled test, unchecked if none are selected,
1709         and checked if all are selected.
1710         (localStorageNameForTest): Helper function to get the name of the test to use as
1711         a key to localStorage.
1712         (populateSettings): Add the tests for each suite into an inner list.
1713
1714 2015-10-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
1715
1716         Add an option to output the results of the graphics benchmark in JSON format
1717         https://bugs.webkit.org/show_bug.cgi?id=150484
1718         <rdar://problem/23243721>
1719
1720         Reviewed by Darin Adler.
1721
1722         * Animometer/resources/extensions.js:
1723         (ResultsDashboard): A new class to hold the iterations results.
1724         (ResultsDashboard.prototype.push): Appends an iteration results;
1725         (ResultsDashboard.prototype.toJSON): Converts the iterations results to JSON format.
1726
1727         (RecordTable.prototype.clear): Clears the results table.
1728         (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
1729         (RecordTable.prototype._showHeader): Shows the table header titles.
1730         (RecordTable.prototype._showEmpty): Shows an empty table cell.
1731         (RecordTable.prototype._showValue): Shows a number value in the results table.
1732         (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
1733         (RecordTable.prototype._showTest): Shows the results of a single test.
1734         (RecordTable.prototype._showSuite): Shows the results of a single suite.
1735         (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
1736         (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
1737
1738         (ResultsTable): RecordTable was renamed to ResultsTable.
1739         (ResultsTable.prototype.clear): Clears the table element.
1740         (ResultsTable.prototype._showHeaderRow): Shows a row in the results table header.
1741         (ResultsTable.prototype._showHeader): Shows the results table header.
1742         (ResultsTable.prototype._showEmpty): Shows an empty table cell.
1743         (ResultsTable.prototype._showText): Shows a string in a new table cell.
1744         (ResultsTable.prototype._showFixedNumber): Shows a number in a new table cell.
1745         (ResultsTable.prototype._showGraph): Shows a button for the sampled data graph.
1746         (ResultsTable.prototype._showJSON): Shows a button for the sampled data JSON.
1747         (ResultsTable.prototype._showTest): Shows the results of a single test.
1748         (ResultsTable.prototype._showSuite): Shows the results of a single suite.
1749         (ResultsTable.prototype._showIteration): Shows the results of a single iteration.
1750         (ResultsTable.prototype.showRecord): Shows a single iteration for a single test.
1751         (ResultsTable.prototype.showIterations): Shows all the results.
1752         (RecordTable): Deleted.
1753         (RecordTable.prototype.clear): Deleted.
1754         (RecordTable.prototype._showTitles): Deleted.
1755         (RecordTable.prototype._showHeader): Deleted.
1756         (RecordTable.prototype._showEmpty): Deleted.
1757         (RecordTable.prototype._showValue): Deleted.
1758         (RecordTable.prototype._showSamples): Deleted.
1759         (RecordTable.prototype._showTest): Deleted.
1760         (RecordTable.prototype._showSuite): Deleted.
1761         (RecordTable.prototype.showRecord): Deleted.
1762         (RecordTable.prototype.showIterations): Deleted.
1763
1764         * Animometer/resources/sampler.js:
1765         (Sampler.prototype.startSampling): Use forEach.
1766         (Sampler.prototype.sample): Use forEach.
1767         (Sampler.prototype.toJSON): Converts the sampler data to JSON format.
1768
1769         * Animometer/resources/strings.js: Added.
1770         This new file will be used to associate the strings used by the benchmark
1771         with IDs. A string can be changed in one place without having to change
1772         all the instances of this string in multiple files. There two groups of
1773         strings in this file. The first one is used by the UI elements and the second
1774         group is used when constructing the results JSON.
1775
1776         * Animometer/runner/animometer.html:
1777         * Animometer/runner/resources/animometer.css:
1778
1779         * Animometer/runner/resources/animometer.js:
1780         (window.benchmarkRunnerClient.willAddTestFrame):
1781         (window.benchmarkRunnerClient.willStartFirstIteration):
1782         (window.benchmarkRunnerClient.didRunSuites):
1783         (window.benchmarkRunnerClient.didFinishLastIteration):
1784         Make benchmarkRunnerClient uses ResultsDashboard instead of _iterationsSamplers
1785         Get the JSON from ResultsDashboard.toJSON() and pass it to ResultsTable.showIterations().
1786         Also set the textContent of the "#json" textarea with the results JSON.
1787
1788         (showResults): Delete unneeded code.
1789         (showJson): Shows the "json" section.
1790         (showTestGraph): Rename showGraph() to be showTestGraph().
1791         (showTestJSON): Shows the JSON of a single testResults.
1792         (showGraph): Deleted.
1793
1794         * Animometer/runner/resources/tests.js:
1795         Use the string table instead of putting literal strings.
1796
1797         * Animometer/tests/resources/stage.js:
1798         (StageBenchmark.prototype.showResults):
1799         Fix the parameters which are passed to RecordTable.showRecord().
1800
1801         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
1802         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
1803         * Animometer/tests/bouncing-particles/bouncing-css-images.html:
1804         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
1805         * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
1806         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
1807         * Animometer/tests/examples/canvas-electrons.html:
1808         * Animometer/tests/examples/canvas-stars.html:
1809         * Animometer/tests/simple/simple-canvas-paths.html:
1810         * Animometer/tests/template/template-canvas.html:
1811         * Animometer/tests/template/template-css.html:
1812         * Animometer/tests/template/template-svg.html:
1813         * Animometer/tests/text/layering-text.html:
1814         Include the new strings.js file in all the test files.
1815
1816 2015-10-12  Jon Lee  <jonlee@apple.com>
1817
1818         Add canvas line dash test
1819         https://bugs.webkit.org/show_bug.cgi?id=150078
1820         <rdar://problem/23082347>
1821
1822         Reviewed by Dean Jackson.
1823
1824         * Animometer/runner/resources/tests.js: Add line dash test.
1825         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1826         (CanvasLineDashStage): Create a new stage with a default dash pattern and stroke style.
1827         Maintain a step which will animate the dash.
1828         (CanvasLineDashStage.prototype.animate): Render the line path with the dash. Increment
1829         the dash offset to animate.
1830         (CanvasPathBenchmark.prototype.createStage): Add the test.
1831
1832 2015-10-12  Jon Lee  <jonlee@apple.com>
1833
1834         Add canvas line path tests
1835         https://bugs.webkit.org/show_bug.cgi?id=150076
1836         <rdar://problem/23082285>
1837
1838         Reviewed by Dean Jackson.
1839
1840         * Animometer/runner/resources/tests.js: Add new line path tests, with different
1841         line joins.
1842         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1843         (CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
1844         but sets the lineJoin on the context.
1845         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1846
1847 2015-10-12  Jon Lee  <jonlee@apple.com>
1848
1849         Add missing paint objects for arc and arcTo fills
1850         https://bugs.webkit.org/show_bug.cgi?id=150075
1851         <rdar://problem/23082233>
1852
1853         Reviewed by Dean Jackson.
1854
1855         * Animometer/tests/simple/resources/simple-canvas-paths.js: Add missing paint objects
1856         for arcTo and arc segment fills.
1857         (CanvasArcToSegmentFill):
1858         (CanvasArcToSegmentFill.prototype.draw):
1859         (CanvasArcSegmentFill):
1860         (CanvasArcSegmentFill.prototype.draw):
1861
1862 2015-10-12  Jon Lee  <jonlee@apple.com>
1863
1864         Add canvas line segment tests
1865         https://bugs.webkit.org/show_bug.cgi?id=150073
1866         <rdar://problem/23082138>
1867
1868         Reviewed by Dean Jackson.
1869
1870         * Animometer/runner/resources/tests.js: Add new line segment tests, with different
1871         line caps.
1872         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1873         (CanvasLineSegment): Add new line segment paint object.
1874         (CanvasLineSegmentStage): Create a new stage that sets the lineCap.
1875
1876 2015-10-12  Jon Lee  <jonlee@apple.com>
1877
1878         Add canvas path fill tests
1879         https://bugs.webkit.org/show_bug.cgi?id=150071
1880         <rdar://problem/23082001>
1881
1882         Reviewed by Dean Jackson.
1883
1884         * Animometer/runner/resources/tests.js: Add new pathTypes for path fills.
1885         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1886         (CanvasLinePoint): Add basic point for a line, and call lineTo.
1887         (SimpleCanvasPathFillStage): Add a new stage similar to SimpleCanvasPathStrokeStage.
1888         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1889
1890 2015-10-12  Jon Lee  <jonlee@apple.com>
1891
1892         Add canvas path tests
1893         https://bugs.webkit.org/show_bug.cgi?id=150067
1894         rdar://problem/23081463
1895
1896         Reviewed by Dean Jackson.
1897
1898         * Animometer/runner/resources/tests.js: Add a quadratic and bezier path test.
1899
1900         * Animometer/tests/simple/resources/simple-canvas.js:
1901         (SimpleCanvasStage.prototype.tune): This kind of test joins all of the segments
1902         into one long path, and tries to render that one path. Random points make it
1903         difficult to tell what is going on, so add a parameter to the constructor to
1904         confine the area where the random coordinates can land. The more complicated the
1905         case is, the larger an area the path will cover. Add an artificial minimum so
1906         that the first 200 points aren't confined to a space that is too small.
1907
1908         * Animometer/tests/simple/resources/simple-canvas-paths.js:
1909         (SimpleCanvasPathStrokeStage): Add a new kind of stage that inherits from
1910         SimpleCanvasStage. Each time the frame animates a random line width and stroke
1911         color are chosen. The path setup is done outside of each paint object.
1912         (CanvasQuadraticPoint): This point just calls quadraticCurveTo.
1913         (CanvasPathBenchmark.prototype.createStage): Add the tests.
1914
1915 2015-10-12  Jon Lee  <jonlee@apple.com>
1916
1917         Add basic canvas tests
1918         https://bugs.webkit.org/show_bug.cgi?id=150066
1919         rdar://problem/23081143
1920
1921         Reviewed by Dean Jackson.
1922
1923         This adds a new test suite that will cover all of the path-based canvas calls.
1924         The patch will be divided up to cover tests with similar techniques.
1925
1926         The simplest version uses a SimpleCanvasStage.
1927
1928         * Animometer/runner/resources/tests.js: Add tests for quadratic, bezier, arcTo,
1929         arc, and rect segments. Also include arcTo, arc, and rect fills.
1930         * Animometer/tests/resources/stage.js:
1931         (Stage.prototype.randomBool): Added for counterclockwise property for arc segments.
1932         (Stage.prototype.randomInt): Fix how values are rounded, used by randomBool. It should
1933         round instead of flooring everything.
1934         * Animometer/tests/simple/resources/simple-canvas.js: Added. Defines common classes
1935         used by all simple canvas tests. The page reads best bottom to top.
1936         (SimpleCanvasStage): Basic stage. Pass a canvasObject which will be used to create new
1937         objects as needed in tune().
1938         (SimpleCanvasStage.prototype.tune): Modeled on other tests. Adds and removed objects
1939         as specified by the provided |count|.
1940         (SimpleCanvasStage.prototype.animate): Iterate over all the objects and ask them to draw.
1941         There is no "animating" of the objects; they will just paint statically on the canvas.
1942         (SimpleCanvasAnimator): Basic animator clears the canvas prior to painting.
1943         (SimpleCanvasBenchmark): Hard-code the feedback loop parameters instead of including
1944         them in the query parameters to the test URLs.
1945         (SimpleCanvasBenchmark.prototype.createAnimator):
1946         * Animometer/tests/simple/simple-canvas-paths.html: Added.
1947
1948         * Animometer/tests/simple/resources/simple-canvas-paths.js: Added. There is no "animating"
1949         of these objects--they just paint statically on the canvas.
1950         (CanvasQuadraticSegment): Paint a quadratic segment stroke.
1951         (CanvasBezierSegment): Paint a bezier segment stroke.
1952         (CanvasArcToSegment): Paint an arcTo stroke.
1953         (CanvasArcSegment): Paint an arc stroke.
1954         (CanvasRect): Paint a rect.
1955         (CanvasRectFill): Paint a filled rect.
1956
1957         (CanvasPathBenchmark):
1958         (CanvasPathBenchmark.prototype.createStage): Look for the pathType and create the
1959         stage using the right paint object.
1960         (window.benchmarkClient.create):
1961
1962 2015-10-12  Jon Lee  <jonlee@apple.com>
1963
1964         Refactor tune() to pass in an integer-based count
1965         https://bugs.webkit.org/show_bug.cgi?id=150060
1966         <rdar://problem/23079425>
1967
1968         Reviewed by Dean Jackson.
1969
1970         All of the tune functions do an initial step of flooring the
1971         # of painting objects to add or remove. Factor that out since
1972         the complexity of all of these tests is always expressed in terms
1973         of countable items.
1974
1975         * Animometer/tests/resources/main.js:
1976         (Benchmark.prototype.update): Update the tuneValue.
1977
1978         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1979         (BouncingParticlesStage.prototype.tune): Remove the count adjustment.
1980         * Animometer/tests/examples/resources/canvas-electrons.js:
1981         (CanvasElectronsStage.prototype.tune): Ditto.
1982         * Animometer/tests/examples/resources/canvas-stars.js:
1983         (CanvasStarsStage.prototype.tune): Ditto.
1984         * Animometer/tests/text/resources/layering-text.js:
1985         (LayeringTextStage.prototype.tune): Ditto.
1986
1987 2015-10-12  Jon Lee  <jonlee@apple.com>
1988
1989         Store test-interval in localStorage
1990         https://bugs.webkit.org/show_bug.cgi?id=150055
1991         <rdar://problem/23078879>
1992
1993         Reviewed by Dean Jackson.
1994
1995         * Animometer/runner/resources/animometer.js:
1996         (populateSettings): Keep track of the specified test interval in localStorage
1997         to make it easy to repeat a test suite.
1998
1999 2015-10-12  Jon Lee  <jonlee@apple.com>
2000
2001         Remove "../tests/" from the URLs of all tests
2002         https://bugs.webkit.org/show_bug.cgi?id=150054
2003         <rdar://problem/23078784>
2004
2005         Reviewed by Dean Jackson.
2006
2007         Presumably all tests will be running from the tests/ directory,
2008         so we don't have to specify it in all of the test URLs.
2009
2010         * Animometer/runner/resources/benchmark-runner.js:
2011         (BenchmarkRunnerState.prototype.prepareCurrentTest): Prepend
2012         "../tests/" to all tests.
2013         * Animometer/runner/resources/tests.js: Remove "../tests/" from
2014         all URLs.
2015
2016 2015-10-12  Jon Lee  <jonlee@apple.com>
2017
2018         Refactor test suites to a separate class.
2019         https://bugs.webkit.org/show_bug.cgi?id=150053
2020         <rdar://problem/23078645>
2021
2022         Reviewed by Dean Jackson.
2023
2024         Create a Suite class to refactor out prepare() and run().
2025         Generate the checkboxes representing the suites using Suites
2026         instead of maintaining a separate list. Also, save the
2027         selections out to localStorage.
2028
2029         * Animometer/runner/animometer.html: Remove the explicitly listed
2030         suites. These will be generated from Suites instead.
2031         * Animometer/runner/resources/animometer.js:
2032         (populateSettings): Iterate through Suites, and create the
2033         label and checkbox. Attach the Suite object to the checkbox so
2034         when the benchmark is started, we get direct access. Initialize
2035         the checkmark based on its value in localStorage. Set this to
2036         run when DOMContentLoaded is dispatched.
2037         (startBenchmark): Grab all of the checkboxes, inspect their
2038         values, add it to enabledSuites if selected. Remember whether
2039         the suite was enabled in localStorage, so that it's easy to do
2040         repeated runs.
2041         * Animometer/runner/resources/tests.js:
2042         (Suite): Create a new Suite class. Refactor out prepare() and
2043         run(), since all of them have the same implementation. Populate
2044         Suites with Suite instances instead of generic objects.
2045
2046 2015-10-12  Jon Lee  <jonlee@apple.com>
2047
2048         Update graph styles for legibility.
2049         https://bugs.webkit.org/show_bug.cgi?id=150052
2050         <rdar://problem/23078503>
2051
2052         Reviewed by Dean Jackson.
2053
2054         * Animometer/runner/resources/animometer.css: Update colors and
2055         stroke thicknesses to make the graphs easier to read.
2056         (.smaple-time): Correct to .sample-time
2057         * Animometer/runner/resources/graph.js:
2058         (graph): Ditto.
2059
2060 2015-10-12  Jon Lee  <jonlee@apple.com>
2061
2062         Update graph styles for legibility.
2063         https://bugs.webkit.org/show_bug.cgi?id=150052
2064         <rdar://problem/23078503>
2065
2066         Reviewed by Dean Jackson.
2067
2068         * Animometer/runner/resources/animometer.css: Update colors and
2069         stroke thicknesses to make the graphs easier to read.
2070         (.smaple-time): Correct to .sample-time
2071         * Animometer/runner/resources/graph.js:
2072         (graph): Ditto.
2073
2074 2015-10-12  Filip Pizlo  <fpizlo@apple.com>
2075
2076         Unreviewed, revert an unintended commit.
2077
2078         * JetStream/Octane2/crypto.js:
2079         (montRevert):
2080         (montReduce):
2081
2082 2015-10-05  Said Abou-Hallawa  <sabouhallawa@apple.com>
2083
2084         Add a graphics benchmark
2085         https://bugs.webkit.org/show_bug.cgi?id=149053
2086         <rdar://problem/18984169>
2087
2088         Reviewed by Dean Jackson.
2089
2090         Instead of measuring the FPS of the animation, this benchmark measures the
2091         test complexity when rendering at a set-point FPS which should be lower
2092         than 60 FPS. This benchmark tries to stay at the set-point FPS by using
2093         a closed loop control system PID function. The gain of the system is passed
2094         as a parameter when running the test. Measuring the FPS faithfully results
2095         very fluctuating values. A Kalman filter is used to give a better estimate
2096         for the current FPS.
2097
2098         The animation of the tests is done manually. requestAnimationFrame() is
2099         called with a callback. Inside this callback, the test is animating by
2100         changing the positions of the elements inside the page. The test complexity
2101         may change also if the current FPS is not equal to the desired FPS.
2102
2103         In this patch, the benchmark and the tests are included. The shared code
2104         and the tests runner are included in separate patches.
2105
2106         * Animometer/runner/animometer.html:
2107         * Animometer/runner/resources/animometer.js:
2108         Add two new examples for more complex animation techniques.
2109         Add an option to show/hide the test running results which is off by default.
2110
2111         * Animometer/runner/resources/tests.js: Added.
2112         (suiteFromName): Returns a suite given its name.
2113         (testFromName): Returns a test given its suite and name.
2114
2115         * Animometer/tests: Added.
2116         This directory includes all the test suites to be run by the benchmark.
2117         runner. All the tests should try to run on three stages: CSS, canvas and
2118         SVG.
2119
2120         * Animometer/tests/bouncing-particles: Added.
2121         * Animometer/tests/bouncing-particles/resources: Added.
2122         The bouncing particles test is an example of a simple animation technique.
2123
2124         * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
2125         * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
2126         * Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
2127         * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
2128         * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
2129         * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
2130         Bouncing particles test pages.
2131
2132         * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.
2133         (BouncingParticle): Base class for a bouncing particle.
2134         (BouncingParticle.prototype.center): Returns the center point or the particle.
2135         (BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.
2136
2137         (BouncingParticlesAnimator): A sub class of Animator.
2138
2139         (BouncingParticlesStage): Represents the container of all the bouncing particles.
2140         (BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
2141         (BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
2142         (BouncingParticlesStage.prototype.animate): Animates all the particles.
2143         (BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.
2144
2145         (BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
2146         (BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.
2147
2148         * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
2149         (BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
2150         (BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
2151         (BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2152         (BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.
2153
2154         (BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
2155         (BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
2156         (BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2157
2158         (BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
2159         (BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
2160         (window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.
2161
2162         * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
2163         (BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
2164         (BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
2165         (BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.
2166
2167         (BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
2168         (BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
2169         (BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2170
2171         (BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
2172         (BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
2173         (window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.
2174
2175         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
2176         (BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
2177         (BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
2178         (BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
2179         (BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
2180         (BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.
2181
2182         (BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.
2183
2184         (BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
2185         (BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2186
2187         (BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
2188         (BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.
2189
2190         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
2191         (BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2192         (BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
2193         (BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
2194         (BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.
2195
2196         (BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2197         (BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.
2198
2199         (BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
2200         (BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
2201         (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.
2202
2203         * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
2204         (BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
2205         (BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.
2206
2207         (BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2208         (BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.
2209
2210         (BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2211         (BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
2212         (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.
2213
2214         * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
2215         (BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
2216         (BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
2217         (BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2218         (BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
2219         (BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
2220         (BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
2221         (BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
2222         (BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
2223         (BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
2224         (BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.
2225
2226         * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
2227         (BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
2228         (BouncingSvgShape.prototype._createShape): Creates an SVG shape.
2229         (BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.
2230
2231         (BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
2232         (BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
2233         (BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
2234         (BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.
2235
2236         (BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2237         (BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
2238         (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.
2239
2240         * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
2241         (BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.
2242
2243         (BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
2244         (BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.
2245
2246         (BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2247         (BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
2248         (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.
2249
2250         * Animometer/tests/examples: Added.
2251         * Animometer/tests/examples/canvas-electrons.html: Added.
2252         * Animometer/tests/examples/canvas-stars.html: Added.
2253         Examples test pages.
2254
2255         * Animometer/tests/examples/resources: Added.
2256         * Animometer/tests/examples/resources/canvas-electrons.js: Added.
2257         (CanvasElectron): An object which draws and animate a electron object on a canvas stage.
2258         (CanvasElectron.prototype._draw): Draws the electron object.
2259         (CanvasElectron.prototype.animate): Animates the electron object.
2260
2261         (CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
2262         (CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
2263         (CanvasElectronsStage.prototype.animate): Animates the test elements.
2264
2265         (CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
2266         (CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2267
2268         (CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
2269         (CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
2270         (CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
2271         (window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.
2272
2273         * Animometer/tests/examples/resources/canvas-stars.js: Added.
2274         (CanvasStar): An object which draws and animate a star object on a canvas stage.
2275         (CanvasStar.prototype._draw): Draws the star object.
2276         (CanvasStar.prototype.animate): Animates the star object.
2277
2278         (CanvasStarsStage): A concrete sub-class of Stage for animating stars.
2279         (CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
2280         (CanvasStarsStage.prototype.animate): Animates the test elements.
2281
2282         (CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
2283         (CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2284
2285         (CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
2286         (CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
2287         (CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
2288         (window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.
2289
2290         * Animometer/tests/resources: Added.
2291         This directory includes the script which is required to run an adaptive
2292         graphics benchmark. From an empty test page, the set of classes in this
2293         directory are responsible for measuring the current frame rate and
2294         changing the test to reach a desired FPS. It keeps asking the test page
2295         to tune itself by a certain value to increase or decrease the frame rate.
2296         It's also responsible for sampling the test state and the corresponding
2297         frame rate.
2298
2299         * Animometer/tests/resources/main.js: Added.
2300         (BenchmarkState): Tracks the state of the benchmark test.
2301         (BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
2302         (BenchmarkState.prototype._message): Returns the message of a stage.
2303         (BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
2304         (BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
2305         (BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
2306         (BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
2307         (BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.
2308
2309         (Animator): Manages animating the test.
2310         (Animator.prototype.start): Called if animating using setInterval is requested.
2311         (Animator.prototype.timeDelta): Returns the current timeDelta
2312         (Animator.prototype.animate): Manages the test animation.
2313         (Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.
2314
2315         (Benchmark): Manages running the test benchmark and recording the sampled data.
2316         (Benchmark.prototype.start): Starts the benchmark.
2317         (Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
2318         (Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
2319         (Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
2320         (Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
2321         (window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.
2322
2323         * Animometer/tests/resources/math.js: Added.
2324         (Matrix): A matrix object.
2325         (Vector3): A vector of size 3 object.
2326         (Matrix3): A matrix of size 3x3 object.
2327
2328         (PIDController): Closed-loop controller for a set-point y.
2329         (PIDController.prototype._sat): Limits the output to a certain range.
2330         (PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.
2331
2332         (KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
2333         (KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.
2334
2335         * Animometer/tests/resources/utilities.js: Added.
2336         (window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
2337         (window.Utilities.parseParameters): Parses a test parameters.
2338         (window.Utilities.parseArguments): Parses a tag arguments.
2339         (window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
2340         (window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
2341         (window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
2342         (window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.
2343
2344         * Animometer/tests/resources/stage.css: Added.
2345         * Animometer/tests/resources/stage.js: Added.
2346         (Rotater): Manages rotating an angle within a fixed time interval.
2347         (Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
2348         (Rotater.prototype.next): Moves the current time by a delta.
2349         (Rotater.prototype.degree): Returns the current rotating degree.
2350         (Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
2351         (Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.
2352
2353         (Stage): A base class for managing the test complexity and test animation.
2354         (Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
2355         (Stage.prototype.random): Returns a random float.
2356         (Stage.prototype.randomInt): Returns a random integer.
2357         (Stage.prototype.randomPosition): Returns a random position.
2358         (Stage.prototype.randomSquareSize): Returns a square size.
2359         (Stage.prototype.randomVelocity): Returns a random velocity.
2360         (Stage.prototype.randomAngle): Returns a random angle.
2361         (Stage.prototype.randomColor): Returns a random color not too dark and not too light.
2362         (Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
2363         (Stage.prototype.tune): A not-implemented version of this function.
2364         (Stage.prototype.animate): A not-implemented version of this function.
2365         (Stage.prototype.clear): Clears the stage from all its animation elements.
2366
2367         (StageAnimator): A base class for the stage-based animators.
2368         (StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.
2369
2370         (StageBenchmark): A base class for the stage-based benchmarks.
2371         (StageBenchmark.prototype.createStage): Creates the default stage.
2372         (StageBenchmark.prototype.createAnimator): Creates the default animator.
2373         (StageBenchmark.prototype.tune): Delegates the call to stage.
2374         (StageBenchmark.prototype.clear): Delegates the call to stage.
2375         (StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.
2376
2377         * Animometer/tests/resources/yin-yang.png: Added.
2378         * Animometer/tests/resources/yin-yang.svg: Added.
2379         These images are shared among all the tests.
2380
2381         * Animometer/tests/template: Added.
2382         * Animometer/tests/template/resources: Added.
2383         This directory includes template tests which do nothing. They can be used
2384         to author new tests. Animated items can be created, moved and redrawn by
2385         removing the TODO comments in the script files and writing actual code.
2386
2387         * Animometer/tests/template/template-css.html: Added.
2388         * Animometer/tests/template/template-canvas.html: Added.
2389         * Animometer/tests/template/template-svg.html: Added.
2390         Template test pages. They can be used as they are. CSS attributes or hidden
2391         elements can be added to these derived test pages if needed.
2392
2393         * Animometer/tests/template/resources/template-css.js: Added.
2394
2395         (TemplateCssStage): A stage to create and animate HTMLElements.
2396         (TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
2397         (TemplateCssStage.prototype.animate): Animates the test elements.
2398         (TemplateCssBenchmark):
2399         (TemplateCssBenchmark.prototype.createStage): Creates the test stage.
2400         (window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.
2401
2402         * Animometer/tests/template/resources/template-canvas.js: Added.
2403         (TemplateCanvasObject):
2404         (TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
2405         (TemplateCanvasObject.prototype.animate): Moves and redraws the object.
2406         (TemplateCanvasStage): A stage to create and animate drawing elements.
2407         (TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
2408         (TemplateCanvasStage.prototype.animate):  Animates the test elements.
2409         (TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
2410         (TemplateCanvasBenchmark):
2411         (TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
2412         (TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
2413         (window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.
2414
2415         * Animometer/tests/template/resources/template-svg.js: Added.
2416         (TemplateSvgStage): A stage to create and animate SVGElements.
2417         (TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
2418         (TemplateSvgStage.prototype.animate): Animates the test elements.
2419         (TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
2420         (window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.
2421
2422         * Animometer/tests/text: Added.
2423         * Animometer/tests/text/resources: Added.
2424         This directory includes the text animating tests which currently runs
2425         on CSS stage only.
2426
2427         * Animometer/tests/text/layering-text.html: Added.
2428         Text test page.
2429
2430         * Animometer/tests/text/resources/layering-text.js: Added.
2431         (LayeringTextStage): Represents the container of all the stacked text layers.
2432         (LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
2433         (LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
2434         (LayeringTextStage.isClosingTextItem): Returns true if  the textItem is an closing tag e.g. '</ol>.
2435         (LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
2436         (LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
2437         (LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
2438         (LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
2439         (LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
2440         (LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
2441         (LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
2442         (LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
2443         (LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
2444         (LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
2445         (LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
2446         (LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
2447         (LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.
2448
2449         (LayeringTextBenchmark): Runs the benchmark for the layering text test.
2450         (LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
2451         (window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.
2452
2453 2015-10-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2454
2455         Add shared code for a new a graphics benchmark
2456         https://bugs.webkit.org/show_bug.cgi?id=149691
2457
2458         Reviewed by Ryosuke Niwa.
2459
2460         This set of classes will be shared and used by the tests and the runner
2461         of a new graphics benchmark.
2462
2463         * Animometer/resources: Added.
2464         * Animometer/resources/algorithm.js: Added.
2465         (Array.prototype.swap): Swaps two elements in an array.
2466         (Heap): Binary Min/Max Heap object
2467         (Heap.prototype._parentIndex): Given the child node index, it returns the parent index.
2468         (Heap.prototype._leftIndex): Given the parent node index, it returns the left node index.
2469         (Heap.prototype._rightIndex): Given the parent node index, it returns the right node index.
2470         (Heap.prototype._childIndex): Given the parent node index, it returns the child index that may violate the heap property.
2471         (Heap.prototype.init): Initializes the heap state.
2472         (Heap.prototype.top): Returns the value stored at the top of the heap.
2473         (Heap.prototype.push): Pushes a new node at the top of the heap.
2474         (Heap.prototype.pop): Extracts the top node of the heap.
2475         (Heap.prototype._bubble): Fixes the heap property by moving upward.
2476         (Heap.prototype._sink): Fixes the heap property by moving downward.
2477         (Heap.prototype.str): Prints the nodes of the heap to a string.
2478         (Heap.prototype.values): Returns the last "size" heap elements values.
2479
2480         (Algorithm.createMinHeap): Creates a size-bounded min-heap object.
2481         (Algorithm.createMaxHeap): Creates a size-bounded max-heap object.
2482
2483         * Animometer/resources/extensions.js: Added.
2484         (Point): Point object but can be used as size also.
2485         (Point.pointOnCircle): Given, the radius of the circle and the angle of the point, it returns a point object.
2486         (Point.pointOnEllipse): Given, the radiuses of the ellipse and the angle of the point, it returns a point object.
2487         (Point.prototype.get width): Should be called when the point is used as size.
2488         (Point.prototype.get height): Should be called when the point is used as size.
2489         (Point.prototype.get center): Should be called when the point is used as size.
2490         (Point.prototype.add): Returns a new point = this + other.
2491         (Point.prototype.subtract): Returns a new point = this - other.
2492         (Point.prototype.multiply): Returns a new point = this * other.
2493         (Point.prototype.move): Moves the point in a given direction, velocity, time period.
2494
2495         (Insets): Represents borders of a container.
2496         (Insets.prototype.get width): Returns left + right.
2497         (Insets.prototype.get height): Returns top + bottom.
2498
2499         (SimplePromise):
2500         (SimplePromise.prototype.then):
2501         (SimplePromise.prototype.resolve):
2502         Moved from Animometer/runner/resources/benchmark-runner.js since tests also need it.
2503
2504         (Options): Benchmark running options as they are set by the user.
2505
2506         (ProgressBar): Manages a progress bar element. The progress bar is divided into equal length ranges.
2507         (ProgressBar.prototype._progressToPercent): Converts the progress into a percentage.
2508         (ProgressBar.prototype.incRange): Moves to the next range (a range is the running time of a single test).
2509         (ProgressBar.prototype.setPos): Draws the current progress in the current range.
2510
2511         (RecordTable): Shows the results of running a benchmark in a tabular form.
2512         (RecordTable.prototype.clear): Clears the results table.
2513         (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
2514         (RecordTable.prototype._showHeader): Shows the table header titles.
2515         (RecordTable.prototype._showEmpty): Shows an empty table cell.
2516         (RecordTable.prototype._showValue): Shows a number value in the results table.
2517         (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
2518         (RecordTable.prototype._showTest): Shows the results of a single test.
2519         (RecordTable.prototype._showSuite): Shows the results of a single suite.
2520         (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
2521         (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
2522
2523         * Animometer/resources/sampler.js: Added.
2524         (Statistics.sampleMean): Returns the sample mean.
2525         (Statistics.unbiasedSampleStandardDeviation): Returns the unbiased sample variance (i.e. with Bessel's correction)
2526         (Statistics.geometricMean): Returns the geometric mean.
2527
2528         (Experiment): Represents a sampling experiment.
2529         (Experiment.prototype._init): Called when the object is created and when startSampling() is called.
2530         (Experiment.prototype.startSampling): Called after warmup period. Restarts collecting sampled data points.
2531         (Experiment.prototype.sample): Add a new data point.
2532         (Experiment.prototype.mean): Returns the sample mean for the current sampled data points.
2533         (Experiment.prototype.standardDeviation): Returns the sample standard deviation for the current sampled data points.
2534         (Experiment.prototype.percentage): Returns the percentage of the standard deviation divided to the mean.
2535         (Experiment.prototype.confidenceIntervalDelta): Calculates the confidence delta for the current sampled data given a confidence level.
2536         (Experiment.prototype.concern): Returns the average of the worst given percentage from the sampled data.
2537         (Experiment.prototype.score): Returns a score for the sampled data. It is the geometric mean of sampleMean and concern.
2538
2539         (Sampler): Represents a compound experiment. It manages sampling multiple data points at the same time offset.
2540         (Sampler.prototype.startSampling): Called after warming up period. Restarts collecting sampled data points.
2541         (Sampler.prototype.sample): Add a new data vector at a given time offset.
2542
2543 2015-10-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
2544
2545         Add the test runner for a new a graphics benchmark
2546         https://bugs.webkit.org/show_bug.cgi?id=149683
2547
2548         Reviewed by Ryosuke Niwa.
2549
2550         The test runner collects the selected test suites and the running options
2551         from its home page. It loops through all the tests, runs them and collects
2552         their running results. At the end, it shows summary results and a final
2553         score. It can also show a chart for a test sampled data.
2554
2555         * Animometer: Added.
2556         * Animometer/runner: Added.
2557         * Animometer/runner/resources: Added.
2558
2559         * Animometer/runner/animometer.html: Added.
2560         * Animometer/runner/resources/animometer.css: Added.
2561         The benchmark runner page and css.
2562
2563         * Animometer/runner/resources/animometer.js: Added.
2564         (window.benchmarkRunnerClient.willAddTestFrame): Called after the test <iframe> is created.
2565         (window.benchmarkRunnerClient.didRunTest): Called after running a test is finished.
2566         (window.benchmarkRunnerClient.willStartFirstIteration): Called at the beginning before running any test.
2567         (window.benchmarkRunnerClient.didRunSuites): Called after running all tests of a suite.
2568         (window.benchmarkRunnerClient.didFinishLastIteration): Called after running the last test.
2569
2570         (showSection): Shows a section in the animometer.html page.
2571         (startTest): Called when the "Start Test" button is clicked.
2572         (showResults): Called after finishing all the tests.
2573         (showGraph): Called when "Click..." button in the "Samples" column of the results table is clicked
2574
2575         * Animometer/runner/resources/benchmark-runner.js: Copied from PerformanceTests/Speedometer/resources/benchmark-runner.js.
2576         (BenchmarkRunnerState): Tracks the current running <suite, test>
2577         (BenchmarkRunnerState.prototype.currentSuite): Returns the current running suite.
2578         (BenchmarkRunnerState.prototype.currentTest): Returns the current running test.
2579         (BenchmarkRunnerState.prototype.isFirstTest): Returns true if we are running the first test in the current suite.
2580         (BenchmarkRunnerState.prototype.next): Advances to the next test.
2581         (BenchmarkRunnerState.prototype.prepareCurrentTest): Creates a new <iframe> and waits for it to load a test.
2582
2583         (BenchmarkRunner): Manages running the tests and communicating with the benchmarkRunnerClient.
2584         (BenchmarkRunner.prototype.waitForElement): Waits for an element to be created.
2585         (BenchmarkRunner.prototype._appendFrame): Creates a new <iframe> element.
2586         (BenchmarkRunner.prototype._removeFrame): Removed the current <iframe> element.
2587         (BenchmarkRunner.prototype._runTestAndRecordResults): Runs the current test and saves its results.
2588         (BenchmarkRunner.prototype.step): Either runs the current test if there is or start a new iteration.
2589         (BenchmarkRunner.prototype.runAllSteps): Loops to run all the tests and move to the next iteration.
2590         (this._runNextIteration): Starts a new iteration or show the results.
2591         (BenchmarkRunner.prototype.runMultipleIterations): Loops to run all the iterations and show the results
2592         (BenchmarkRunner.prototype._finalize): Finalizes the current iteration and starts a new one.
2593
2594         (SimplePromise): Deleted.
2595         (SimplePromise.prototype.then): Deleted.
2596         (SimplePromise.prototype.resolve): Deleted.
2597         (BenchmarkTestStep): Deleted.
2598         (Fibonacci): Deleted.
2599         SimplePromise was moved t Animometer/resources/extensions.js because it is used by the runner and the tests.
2600
2601         (BenchmarkRunner.prototype._waitAndWarmUp): Deleted.
2602         (BenchmarkRunner.prototype._runTest): Deleted.
2603         (BenchmarkState.prototype.currentSuite): Deleted.
2604         (BenchmarkState.prototype.currentTest): Deleted.
2605         (BenchmarkState.prototype.next): Deleted.
2606         (BenchmarkState.prototype.isFirstTest): Deleted.
2607         (BenchmarkState.prototype.prepareCurrentSuite): Deleted.
2608         BenchmarkState was renamed to BenchmarkRunnerState to not be confused with the tests BenchmarkState.
2609
2610         * Animometer/runner/resources/d3.min.js: Copied from Websites/perf.webkit.org/public/v2/js/d3/d3.min.js.
2611         Needed for drawing charts for the sampled scores and frame rates.
2612
2613         * Animometer/runner/resources/graph.js: Added.
2614         (graph): Draws a chart for a test sampled data. It shows two y-axes: one for the animated items and the second for FPS.
2615
2616         * Skipped: Skip the Animometer benchmark for now.
2617
2618 2015-08-27  Csaba Osztrogonác  <ossy@webkit.org>
2619
2620         [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
2621         https://bugs.webkit.org/show_bug.cgi?id=148470
2622
2623         Unreviewed gardening, skip the hanging test to make the performance bot work.
2624
2625         * Skipped:
2626
2627 2015-08-17  Chris Dumez  <cdumez@apple.com>
2628
2629         Add performance tests for traversal of collections returned by getElementsByClassName() / getElementsByTagName()
2630         https://bugs.webkit.org/show_bug.cgi?id=148080
2631
2632         Reviewed by Antti Koivisto.
2633
2634         Add performance tests for traversal of *uncached* collections returned
2635         by getElementsByClassName() / getElementsByTagName(). These methods
2636         will soon be updated to return an HTMLCollection instead of a
2637         NodeList and we need to make sure we don't regress performance in the
2638         process.
2639
2640         * DOM/get-elements-by-class-name-traversal-uncached.html: Added.
2641         * DOM/get-elements-by-tag-name-traversal-uncached.html: Added.
2642
2643 2015-08-14  Chris Dumez  <cdumez@apple.com>
2644
2645         Add performance tests for NodeList and HTMLCollection traversal
2646         https://bugs.webkit.org/show_bug.cgi?id=148043
2647
2648         Reviewed by Gavin Barraclough.
2649
2650         Add performance tests for NodeList and HTMLCollection traversal.
2651         Ideally, those 2 tests should be as fast. However, due to inefficiencies
2652         in our HTMLCollection bindings code, the HTMLCollection tests is ~30%
2653         slower. This will be addressed in the near future.
2654
2655         * Bindings/childNodes-traversal.html: Added.
2656         * Bindings/children-traversal.html: Added.
2657
2658 2015-08-05  Myles C. Maxfield  <mmaxfield@apple.com>
2659
2660         Add a second font-fallback performance test
2661         https://bugs.webkit.org/show_bug.cgi?id=147692
2662
2663         Reviewed by Ryosuke Niwa.
2664
2665         This test is smaller, but has more realistic content. Also, it uses the "lang" attribute.
2666
2667         * Layout/font-fallback-2.html: Added.
2668         * Layout/resources/font-fallback-2.html: Added.
2669
2670 2015-07-13  Filip Pizlo  <fpizlo@apple.com>
2671
2672         Update JetStream version number to 1.1.
2673
2674         Rubber stamped by Ryosuke Niwa.
2675
2676         * JetStream/create.rb:
2677
2678 2015-06-30  Filip Pizlo  <fpizlo@apple.com>
2679
2680         Update the JetStream documentation to reflect the recent changes
2681         https://bugs.webkit.org/show_bug.cgi?id=146474
2682
2683         Reviewed by Geoffrey Garen.
2684
2685         * JetStream/create.rb: Bump the version.
2686         * JetStream/in-depth-TEMPLATE.html: Add cdjs documentation. Remove cordic documentation. Change documentation for splay and mandreel.
2687
2688 2015-06-26  Filip Pizlo  <fpizlo@apple.com>
2689
2690         [JetStream] Raise the percentile of mandreel-latency and splay-latency
2691         https://bugs.webkit.org/show_bug.cgi?id=146378
2692
2693         Reviewed by Mark Lam.
2694
2695         The current percentile is 95%.  When I looked at the sample lists in our GC, it was
2696         clear that the worst 5% samples completely amortize our GC pauses.  Our GC pauses can
2697         be quite bad.  Clearly, splay-latency is meant to test whether we have an incremental
2698         GC that ensures that you don't have bad worst-case pauses.  But 95% is too small,
2699         because it doesn't really capture those pauses.  Raising the percentile to above 99%
2700         appears to do the trick.  99.5% or more seems like a good bet.  The trade-off there is
2701         just that if we set it too high, then we won't have enough statistics.  Doing this very
2702         clearly rewards GCs that are incremental, and punishes GCs that aren't (like ours).
2703         That's what we want, since in the future we want to use this test to guide any
2704         improvements to the worst-case performance of our GC.
2705
2706         The way that the percentile is selected will also affect mandreel-latency.  That's a
2707         good thing, because 95% is probably too low for that test as well.  That test ends up
2708         with >10k samples.  The goal of using 95% in the first place was to get enough samples
2709         to have a stable average.  But if we have >10k samples, we can push that percentile up
2710         much higher and still get good statistics while achieving the effect we want - i.e.
2711         getting the worst case.
2712
2713         I don't think that we need to do the same thing for cdjs.  That test only takes 200
2714         samples, so 95% means we report the average of the worst 10 samples.  That's probably
2715         good enough.
2716
2717         * JetStream/Octane2/base.js: Raise the percentile as described above.
2718         (BenchmarkSuite.prototype.RunSingleBenchmark):
2719         * JetStream/Reference.js: Tweak the reference times to bring the latency tests closer to 100ish on my machine.
2720         * JetStream/create.rb: Bump the version.
2721
2722 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2723
2724         Run CDjs as part of JSC stress testing
2725         https://bugs.webkit.org/show_bug.cgi?id=146174
2726
2727         Reviewed by Geoffrey Garen.
2728
2729         * JetStream/cdjs/cdjs-tests.yaml: Added. This tells JSC stress tests what tests to run. It uses new syntax ("tests" being a list) that I add in this change.
2730         * JetStream/cdjs/main.js: Mark this as a slow test.
2731         * JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
2732
2733 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2734
2735         Unreviewed, fix a small indentation goof.
2736
2737         * JetStream/cdjs/motion.js:
2738         (Motion.prototype.findIntersection):
2739
2740 2015-06-19  Filip Pizlo  <fpizlo@apple.com>
2741
2742         JetStream should include a JavaScript version of the CDx real-time benchmark
2743         https://bugs.webkit.org/show_bug.cgi?id=146156
2744
2745         Reviewed by Geoffrey Garen.
2746
2747         This adds a JavaScript port of the CDx real-time benchmark to JetStream, and retires
2748         the cordic test because it was previously the smallest and probably least interesting.
2749
2750         The new test, "cdjs", is mostly a faithful rewrite of the Java code into JavaScript.
2751         I got the Java code from https://www.cs.purdue.edu/sss/projects/cdx/.
2752
2753         There are some differences:
2754
2755         - It uses RedBlackTree's for all sets and maps rather than hashtables. This is clearly
2756           more in the spirit of real-time than the CDx benchmark. FWIW, CDx used to use trees
2757           and I don't know why that changed in the latest version.
2758
2759         - CDjs doesn't attempt to avoid memory allocations, unlike the real-time Java version.
2760           I wrote the code that I wanted to write for aesthetics, rather than the code that I
2761           would have written if I tried to write the fastest code possible. Again, I believe
2762           that this is in the spirit of CDj - it's meant to test what would happen if you wrote
2763           real-timey stuff in a high level language and actually took advantage of that
2764           language to be more productive.
2765
2766         The test score reflects the average latency of the worst 10 samples out of 200 samples.
2767         The simulation uses 1000 aircraft, flying along paths that result in some detected
2768         collisions every once in a while. The benchmark validates its results by checking the
2769         total number of collisions detected.
2770
2771         Apart from the integration into the JetStream harness, the CDjs directory contains a
2772         fully self-contained benchmark that could be run either in the jsc shell or in browser.
2773
2774         This new code uses the same 3-clause BSD license as the Purdue code, and gives
2775         attribution to Purdue in almost all files. I believe that is appropriate since I wrote
2776         most of the JS files by looking at the Purdue Java code and trascribing to JavaScript.
2777         In some cases, I even copy-pasted the Java code, like the complicated math for
2778         four-dimensional intersections and voxel hashing.
2779
2780         * JetStream/CDjsSetup.js: Added.
2781         * JetStream/Octane2Setup.js:
2782         * JetStream/Reference.js:
2783         * JetStream/cdjs: Added.
2784         * JetStream/cdjs/benchmark.js: Added.
2785         (benchmark):
2786         * JetStream/cdjs/call_sign.js: Added.
2787         (CallSign):
2788         (CallSign.prototype.compareTo):
2789         (CallSign.prototype.toString):
2790         * JetStream/cdjs/collision.js: Added.
2791         (Collision):
2792         (Collision.prototype.toString):
2793         * JetStream/cdjs/collision_detector.js: Added.
2794         (CollisionDetector):
2795         (CollisionDetector.prototype.handleNewFrame.get for):
2796         (CollisionDetector.prototype.handleNewFrame):
2797         * JetStream/cdjs/constants.js: Added.
2798         * JetStream/cdjs/main.html: Added.
2799         * JetStream/cdjs/main.js: Added.
2800         * JetStream/cdjs/motion.js: Added.
2801         (Motion):
2802         (Motion.prototype.toString):
2803         (Motion.prototype.delta):
2804         (Motion.prototype.findIntersection):
2805         * JetStream/cdjs/motion_test.js: Added.
2806         (checkDoesIntersect):
2807         (checkDoesNotIntersect):
2808         (makeMotion):
2809         * JetStream/cdjs/red_black_tree.js: Added.
2810         (RedBlackTree):
2811         (RedBlackTree.):
2812         * JetStream/cdjs/red_black_tree_test.js: Added.
2813         (test):
2814         (test.):
2815         * JetStream/cdjs/reduce_collision_set.js: Added.
2816         (drawMotionOnVoxelMap):
2817         (drawMotionOnVoxelMap.):
2818         (.get reduceCollisionSet):
2819         * JetStream/cdjs/reduce_collision_set_test.js: Added.
2820         (makeMotion):
2821         (keys):
2822         (test):
2823         * JetStream/cdjs/simulator.js: Added.
2824         (Simulator):
2825         (Simulator.prototype.simulate):
2826         * JetStream/cdjs/util.js: Added.
2827         (compareNumbers):
2828         (averageAbovePercentile):
2829         (currentTime):
2830         (else.currentTime):
2831         * JetStream/cdjs/vector_2d.js: Added.
2832         (Vector2D):
2833         (Vector2D.prototype.plus):
2834         (Vector2D.prototype.minus):
2835         (Vector2D.prototype.toString):
2836         (Vector2D.prototype.compareTo):
2837         * JetStream/cdjs/vector_3d.js: Added.
2838         (Vector3D):
2839         (Vector3D.prototype.plus):
2840         (Vector3D.prototype.minus):
2841         (Vector3D.prototype.dot):
2842         (Vector3D.prototype.squaredMagnitude):
2843         (Vector3D.prototype.magnitude):
2844         (Vector3D.prototype.times):
2845         (Vector3D.prototype.as2D):
2846         (Vector3D.prototype.toString):
2847         * JetStream/create.rb:
2848         * JetStream/index-TEMPLATE.html:
2849         * JetStream/sunspider/cordic.js: Removed.
2850
2851 2015-06-17  Javier Fernandez  <jfernandez@igalia.com>
2852
2853         [CSS Grid Layout] We should add performance tests for stretching logic
2854         https://bugs.webkit.org/show_bug.cgi?id=146063
2855
2856         Reviewed by Sergio Villar Senin.
2857
2858         Added a new performance test for Grid Layout to ensure there are no
2859         regressions in the stretching alignment logic.
2860
2861         * Layout/fixed-grid-lots-of-stretched-data.html: Added.
2862
2863 2015-06-17  Javier Fernandez  <jfernandez@igalia.com>
2864
2865         [CSS Grid Layout] Performance tests are using the old syntax
2866         https://bugs.webkit.org/show_bug.cgi?id=146061
2867
2868         Reviewed by Sergio Villar Senin.
2869
2870         Adapted tests to the new grid tracks definition syntax.
2871
2872         * Layout/auto-grid-lots-of-data.html:
2873         * Layout/fixed-grid-lots-of-data.html:
2874
2875 2015-06-08  Filip Pizlo  <fpizlo@apple.com>
2876
2877         JetStream should have a more rational story for jitter-oriented latency tests
2878         https://bugs.webkit.org/show_bug.cgi?id=145762
2879
2880         Reviewed by Geoffrey Garen.
2881
2882         JetStream has some latency tests that are meant to measure jitter.  Prior to this change, they
2883         did this by computing the RMS.  But the RMS is a pretty bad metric.  The thing that it rewards
2884         isn't really the thing that you'd want your browser to do.  These RMS-based tests involve taking
2885         the geomean of the RMS of some samples and the sample average.  The lower the geomean, the better
2886         (in the JetStream harness we then invert the scores so that higher is better, but let's ignore
2887         that for this discussion and assume that lower is better).  Here's an example of how this can go
2888         bad.  A browser that always computes a task in some horribly long time (say, 1000ms) but never
2889         varies that time will perform better than a browser that usually computes the task super quickly
2890         (say, 10ms) and sometimes just a little bit less quickly (say, 15ms).  The former browser will
2891         have an RMS of 0 and an average of 1000.  The latter will have a RMS somewhere around 3.5 and an
2892         average of 12.5 (assuming equal probability of 10ms and 15ms).  The geomean of (0, 1000) is 0.
2893         The geomean of (3.5, 12.5) is 6.6.  Lower is better, so the former browser scores higher - even
2894         though it's obviously never better to have a browser always complete a task in 1000ms when a
2895         different browser can do it in 15ms in the worst case.
2896
2897         JetStream should not have this pathology.  The right way of avoiding it is to replace RMS with
2898         some other metric of how bad things get.  A good metric is the average of the worst percentile.
2899         The worst 1% or the worst 5% would be good things to average.  This will catch cases where the VM
2900         jittered due to JIT or GC, but it never have the pathology that we end up giving the better score
2901         to a VM whose best case is worst than another VM's worst case.
2902
2903         For now, this change uses the highest samples above the 95% percentile. I'm not yet sure if that
2904         is the best thing - it might include too many scores that are around the best-case performance -
2905         but it's certainly better than RMS and it might be good enough to keep. But because of that
2906         uncertainty, I'm setting the version to be "1.1-alpha1" to indicate that we aren't ready to
2907         release this yet.
2908
2909         * JetStream/Octane2/base.js:
2910         (.this.Setup.setup.setup):
2911         (.this.TearDown.tearDown.tearDown):
2912         (BenchmarkSuite.GeometricMeanTime):
2913         (BenchmarkSuite.AverageAbovePercentile):
2914         (BenchmarkSuite.GeometricMeanLatency):
2915         (BenchmarkSuite.prototype.NotifyStep):
2916         (BenchmarkSuite.prototype.RunSingleBenchmark):
2917         * JetStream/Octane2/mandreel.js:
2918         (setupMandreel):
2919         (updateMandreelStats):
2920         (startMandreelTimer):
2921         (latencyMandreel):
2922         (tearDownMandreel):
2923         (RMSMandreel): Deleted.
2924         * JetStream/Octane2/splay.js:
2925         (GenerateKey):
2926         (SplayUpdateStats):
2927         (InsertNewNode):
2928         (SplayTearDown):
2929         (SplayRMS): Deleted.
2930         * JetStream/create.rb:
2931
2932 2015-06-03  Zalan Bujtas  <zalan@apple.com>
2933
2934         Skip Dromaeo/jslib-modify-prototype.html for now.
2935
2936         Unreviewed gardening.
2937
2938         * Skipped:
2939
2940 2015-05-04  Filip Pizlo  <fpizlo@apple.com>
2941
2942         Large array shouldn't be slow
2943         https://bugs.webkit.org/show_bug.cgi?id=144617
2944
2945         Reviewed by Geoffrey Garen.
2946
2947         Add the hash-map benchmark to LongSpider. LongSpider was already not a perfect match of
2948         SunSpider. It's not an official benchmark. It contains benchmarks that are relatively
2949         long-running. So, hash-map sort of belongs here.
2950
2951         * LongSpider/hash-map.js: Added.
2952         (HashMap):
2953         (HashMap.):
2954         (.get var):
2955
2956 2015-05-01  Dewei Zhu  <dewei_zhu@apple.com>
2957
2958         Fix typo bug in Speedometer/resources/main.js
2959         https://bugs.webkit.org/show_bug.cgi?id=144504
2960
2961         Reviewed by Ryosuke Niwa.
2962
2963         * Speedometer/resources/main.js: Fix typo.
2964         (window.benchmarkClient.totalTimeInDisplayUnit):
2965
2966 2015-04-21  Ryosuke Niwa  <rniwa@webkit.org>
2967
2968         Add JetStream to PerformanceTests
2969         https://bugs.webkit.org/show_bug.cgi?id=144024
2970
2971         Rubber-stamped by Filip Pizlo.
2972
2973         * JetStream: Added.
2974         * JetStream/JetStream-Logo.png: Added.
2975         * JetStream/JetStream-Logo@2x.png: Added.
2976         * JetStream/JetStream.css: Added.
2977         * JetStream/JetStreamDriver.js: Added.
2978         * JetStream/LICENSE.txt: Added.
2979         * JetStream/LLVM-test-suite-LICENSE.txt: Added.
2980         * JetStream/Octane: Added.
2981         * JetStream/Octane/base.js: Added.
2982         * JetStream/Octane/code-load.js: Added.
2983         * JetStream/Octane2: Added.
2984         * JetStream/Octane2/base.js: Added.
2985         * JetStream/Octane2/box2d.js: Added.
2986         * JetStream/Octane2/code-load.js: Added.
2987         * JetStream/Octane2/crypto.js: Added.
2988         * JetStream/Octane2/deltablue.js: Added.
2989         * JetStream/Octane2/earley-boyer.js: Added.
2990         * JetStream/Octane2/gbemu-part1.js: Added.
2991         * JetStream/Octane2/gbemu-part2.js: Added.
2992         * JetStream/Octane2/mandreel.js: Added.
2993         * JetStream/Octane2/navier-stokes.js: Added.
2994         * JetStream/Octane2/pdfjs.js: Added.
2995         * JetStream/Octane2/raytrace.js: Added.
2996         * JetStream/Octane2/regexp.js: Added.
2997         * JetStream/Octane2/richards.js: Added.
2998         * JetStream/Octane2/run.js: Added.
2999         * JetStream/Octane2/splay.js: Added.
3000         * JetStream/Octane2/typescript-compiler.js: Added.
3001         * JetStream/Octane2/typescript-input.js: Added.
3002         * JetStream/Octane2/typescript.js: Added.
3003         * JetStream/Octane2/zlib-data.js: Added.
3004         * JetStream/Octane2/zlib.js: Added.
3005         * JetStream/Octane2Setup.js: Added.
3006         * JetStream/OctaneSetup.js: Added.
3007         * JetStream/README: Added.
3008         * JetStream/Reference.js: Added.
3009         * JetStream/SimpleSetup.js: Added.
3010         * JetStream/SunSpiderSetup.js: Added.
3011         * JetStream/Swoosh.png: Added.
3012         * JetStream/Swoosh@2x.png: Added.
3013         * JetStream/TestingSetup.js: Added.
3014         * JetStream/create.rb: Added.
3015         * JetStream/docs: Added.
3016         * JetStream/docs/JetStreamBlogPost.html: Added.
3017         * JetStream/in-depth-TEMPLATE.html: Added.
3018         * JetStream/index-TEMPLATE.html: Added.
3019         * JetStream/simple: Added.
3020         * JetStream/simple/bigfib.cpp: Added.
3021         * JetStream/simple/bigfib.cpp.js: Added.
3022         * JetStream/simple/container.cpp: Added.
3023         * JetStream/simple/container.cpp.js: Added.
3024         * JetStream/simple/dry.c: Added.
3025         * JetStream/simple/dry.c.js: Added.
3026         * JetStream/simple/float-mm.c: Added.
3027         * JetStream/simple/float-mm.c.js: Added.
3028         * JetStream/simple/gcc-loops.cpp: Added.
3029         * JetStream/simple/gcc-loops.cpp.js: Added.
3030         * JetStream/simple/hash-map.js: Added.
3031         * JetStream/simple/n-body.c: Added.
3032         * JetStream/simple/n-body.c.js: Added.
3033         * JetStream/simple/quicksort.c: Added.
3034         * JetStream/simple/quicksort.c.js: Added.
3035         * JetStream/simple/towers.c: Added.
3036         * JetStream/simple/towers.c.js: Added.
3037         * JetStream/sunspider: Added.
3038         * JetStream/sunspider/3d-cube.js: Added.
3039         * JetStream/sunspider/3d-raytrace.js: Added.
3040         * JetStream/sunspider/base64.js: Added.
3041         * JetStream/sunspider/cordic.js: Added.
3042         * JetStream/sunspider/crypto-aes.js: Added.
3043         * JetStream/sunspider/crypto-md5.js: Added.
3044         * JetStream/sunspider/crypto-sha1.js: Added.
3045         * JetStream/sunspider/date-format-tofte.js: Added.
3046         * JetStream/sunspider/date-format-xparb.js: Added.
3047         * JetStream/sunspider/n-body.js: Added.
3048         * JetStream/sunspider/regex-dna.js: Added.
3049         * JetStream/sunspider/tagcloud.js: Added.
3050
3051 2015-04-14  Said Abou-Hallawa  <sabouhallawa@apple.com>
3052
3053         textPath layout performance improvement.
3054         https://bugs.webkit.org/show_bug.cgi?id=141570.
3055
3056         Reviewed by Darin Adler.
3057
3058         Cut down the time spent in traversing the path for text by 50%. Instead
3059         of traversing the path twice at a certain length: one time for the position
3060         and the second time for the angle, we can merge these two passes into one.
3061
3062         * SVG/TextOnPathSimple.html: Added.
3063         * SVG/resources/TextOnPathSimple.svg: Added.
3064
3065 2015-04-13  Zalan Bujtas  <zalan@apple.com>
3066
3067         Clear up the test content when test is done.
3068
3069         Unreviewed fix.
3070
3071         * Layout/simple-line-layout-innertext.html:
3072
3073 2015-04-09  Zalan Bujtas  <zalan@apple.com>
3074
3075         Simple line layout(regression): Calling innerText on RenderFlow with multiple children is slow.
3076         https://bugs.webkit.org/show_bug.cgi?id=143554
3077
3078         Reviewed by Antti Koivisto.
3079
3080         Initialize render flow's segments only when the render flow changes in TextIterator.
3081         The included performance test shows 6x speedup. (from ~10 runs/sec to ~60 runs/sec)
3082
3083         * Layout/simple-line-layout-innertext.html: Added.
3084
3085 2015-03-09  Chris Dumez  <cdumez@apple.com>
3086
3087         [CG] Have Canvas use the IOSurfacePool
3088         https://bugs.webkit.org/show_bug.cgi?id=142417
3089         <rdar://problem/20044440>
3090
3091         Reviewed by Darin Adler.
3092
3093         Lower the number of different canvas sizes from 1000 to 100 so that
3094         the test does not require such a huge cache size. With 100, we now
3095         get over 90% cache hit rate with the default IOSurfacePool size.
3096
3097         * Canvas/reuse.html:
3098
3099 2015-01-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3100
3101         Poor performance on IE's Chalkboard benchmark.
3102         https://bugs.webkit.org/show_bug.cgi?id=140753.
3103
3104         Reviewed by Zalan Bujtas.
3105
3106         * SVG/UnderTheSeeBenchmark.html: Added
3107         * SVG/WorldcupBenchmark.html: Added.
3108         * SVG/resources/RenderAnimator.css: Added.
3109         * SVG/resources/RenderAnimator.js: Added.
3110         These are benchmarks for the SVG rendering. Mainly we want to measure how fast
3111         the SVG rendering will be when only a small part of it is drawn.
3112
3113 2015-01-21  Geoffrey Garen  <ggaren@apple.com>
3114
3115         bmalloc: support aligned allocation
3116         https://bugs.webkit.org/show_bug.cgi?id=140732
3117
3118         Reviewed by Andreas Kling.
3119
3120         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
3121         * MallocBench/MallocBench/Benchmark.cpp:
3122         * MallocBench/MallocBench/memalign.cpp:
3123         (test):
3124         (benchmark_memalign): Added a test for specific interesting memalign values.
3125
3126         * MallocBench/MallocBench/stress_aligned.cpp: Added.
3127         (benchmark_stress_aligned):
3128         * MallocBench/MallocBench/stress_aligned.h: Added. Added a stress test
3129         for arbitrary memalign values.
3130
3131 2015-01-16  Geoffrey Garen  <ggaren@apple.com>
3132
3133         bmalloc: added the tiniest bit of testing for aligned allocation
3134         https://bugs.webkit.org/show_bug.cgi?id=140573
3135
3136         Reviewed by Andreas Kling.
3137
3138         Just good enoug to catch two bugs in a preliminary implementation.
3139
3140         * MallocBench/MallocBench.xcodeproj/project.pbxproj:
3141         * MallocBench/MallocBench/Benchmark.cpp:
3142         * MallocBench/MallocBench/mbmalloc.cpp:
3143         * MallocBench/MallocBench/mbmalloc.h:
3144         * MallocBench/MallocBench/memalign.cpp: Added.
3145         (benchmark_memalign):
3146         * MallocBench/MallocBench/memalign.h: Added.
3147
3148 2014-12-09  Myles C. Maxfield  <mmaxfield@apple.com>
3149
3150         Add performance test related to font fallback
3151         https://bugs.webkit.org/show_bug.cgi?id=139332
3152
3153         Reviewed by Simon Fraser.
3154
3155         * Layout/font-fallback.html: Added.
3156         * Layout/resources/font-fallback.html: Added.
3157
3158 2014-12-08  Dean Jackson  <dino@apple.com>
3159
3160         [Apple] Use Accelerate framework to speed-up FEGaussianBlur
3161         https://bugs.webkit.org/show_bug.cgi?id=139310
3162
3163         Reviewed by Simon Fraser.
3164
3165         Add an interactive performance test that measures the speed of a set
3166         of blur operations on a generated images.
3167
3168         * Interactive/blur-filter-timing.html: Added.
3169
3170 2014-11-13  Zalan Bujtas  <zalan@apple.com>
3171
3172         Simple line layout: Add performance test case to measure line layout speed of monolithic text content.
3173         https://bugs.webkit.org/show_bug.cgi?id=138699
3174
3175         Reviewed by Antti Koivisto.
3176
3177         * Layout/line-layout-long-long-text.html: Added.
3178
3179 2014-10-22  Zalan Bujtas  <zalan@apple.com>
3180
3181         Speed up line parsing for simple line layout (part I)
3182         https://bugs.webkit.org/show_bug.cgi?id=137275
3183
3184         Reviewed by Antti Koivisto.
3185
3186         Extend simple line layout performance test with a few more cases.
3187         Now we've got:
3188         <div center
3189         <div right
3190         <div justify
3191         <div white-space: pre (new)
3192         <div overflow-wrap: break-word (new)
3193         <pre
3194         <pre white-space: pre-wrap
3195         <pre white-space: pre-line (new)
3196         <pre white-space: nowrap (new)
3197         <pre white-space: pre-wrap overflow-wrap: break-word
3198         <div + embedded <span etc.
3199         <div + br
3200
3201         * Layout/line-layout-simple.html:
3202
3203 2014-10-15  Andrei Bucur  <abucur@adobe.com>
3204
3205         [Multicol] Start adding performance tests for the multi-column implementation
3206         https://bugs.webkit.org/show_bug.cgi?id=137687
3207
3208         Reviewed by Mihnea Ovidenie.
3209
3210         This patch creates a Multicol folder inside the Layout performance tests suite. It adds only two tests
3211         as described below.
3212
3213         The tests are skipped until the implementation stabilizes.
3214
3215         * Layout/Multicol/MulticolManyColumns.html: Added.
3216         This test verifies the performance of the multi-column implementation with two nested multi-column
3217         containers, the first having 20 columns and the second 10 columns.
3218
3219         * Layout/Multicol/MulticolNested.html: Added.
3220         This test verifies the performance of nesting multi-column containers in the presence
3221         of floats.
3222
3223         * Layout/Multicol/resources/multicol-content-many-columns.html: Added.
3224         * Layout/Multicol/resources/multicol-content-nested.html: Added.
3225         * Skipped: Skip the Multicol folder for now.
3226
3227 2014-09-29  Filip Pizlo  <fpizlo@apple.com>
3228
3229         It should be fun and easy to run every possible JavaScript benchmark from the command line
3230         https://bugs.webkit.org/show_bug.cgi?id=137245
3231
3232         Reviewed by Oliver Hunt.
3233
3234         This adds the scaffolding for running Octane version 2 inside run-jsc-benchmarks.
3235         In the future we should just land Octane2 in this directory, and run-jsc-benchmarks
3236         should be changed to point directly at this directory instead of requiring the
3237         Octane path to be configured as part of the configuration file.
3238
3239         * Octane: Added.