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