1 2016-02-10 Jon Lee <jonlee@apple.com>
3 Add new benchmark tests.
4 https://bugs.webkit.org/show_bug.cgi?id=154063
6 Provisionally reviewed by Said Abou-Hallawa.
8 Add tests for get/put image data, filters, opacity, and css transforms.
10 * Animometer/resources/runner/benchmark-runner.js:
11 (_runBenchmarkAndRecordResults): Update the body background color to match that of
13 (this._runNextIteration): Clear the background color style for the results page.
14 * Animometer/resources/runner/tests.js:
15 * Animometer/tests/master/focus.html: Added.
16 * Animometer/tests/master/image-data.html: Added.
17 * Animometer/tests/master/multiply.html: Added.
18 * Animometer/tests/master/resources/focus.js: Added.
19 * Animometer/tests/master/resources/image-data.js: Added.
20 * Animometer/tests/master/resources/multiply.js: Added.
21 * Animometer/tests/master/resources/stage.css: Move common styles out.
22 * Animometer/tests/resources/main.js: Update Stage.randomBool to use Math.random.
23 Add Stage.randomSign for randomly setting a direction. Add the notion of the
24 current timestamp of the test to Benchmark, since some animations cycle through
25 colors and rely on an incremental counter like the time.
27 2016-02-09 Said Abou-Hallawa <sabouhallawa@apple.com>
29 Add internal benchmark tests for CSS mix-blend-modes and filters
30 https://bugs.webkit.org/show_bug.cgi?id=154058
32 Provisionally reviewed by Jon Lee.
34 * Animometer/resources/debug-runner/tests.js: Include the new tests in the
35 "HTML suite" of the debug runner.
37 * Animometer/resources/extensions.js:
38 (Utilities.browserPrefix):
39 (Utilities.setElementPrefixedProperty): Utility functions to allow setting
40 prefixed style properties.
42 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
43 Set the mix-blend-mode and the filter to some random values if the options
44 of the test requested that.
46 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
47 (parseShapeParameters): Parse the url options "blend" and "filter" and set
48 the corresponding flags.
50 * Animometer/tests/resources/main.js:
51 (randomStyleMixBlendMode):
52 (randomStyleFilter): Return random mix-blend-mode and filter.
54 2016-02-08 Jon Lee <jonlee@apple.com>
57 https://bugs.webkit.org/show_bug.cgi?id=154028
59 Provisionally reviewed by Said Abou-Hallawa.
61 Enhance the graph to include a complexity-fps graph, in addition
64 * Animometer/developer.html: Add a ramp option.
65 * Animometer/resources/debug-runner/animometer.css: Update the style.
66 * Animometer/resources/strings.js: Flatten the Strings.text constants.
67 * Animometer/resources/debug-runner/animometer.js:
68 (ResultsTable.call._addGraphButton): Refactor.
69 (ResultsTable.call._addTest): Add regression data.
70 (benchmarkController): Add a form that allows the user to switch between the two forms,
71 Add a form that allows the user to toggle different data. Hide certain header columns
72 depending on the selected controller.
73 * Animometer/resources/debug-runner/graph.js: Add the complexity regressions.
74 * Animometer/resources/debug-runner/tests.js: Add headers for the ramp results.
75 * Animometer/resources/runner/animometer.js:
76 (ResultsTable): If a header is disabled don't include them in _flattenedHeaders.
77 * Animometer/tests/resources/main.js:
78 (Controller): Allow options to specify the capacity for sample arrays.
79 (Regression): A piecewise regression that tries to fit a slope and a flat profile.
80 (_calculateRegression): Options can fix the slope and bias when calculating the minimal
81 error. Sweep across the samples in time (which could be backward depending on the controller)
82 and calculate the intersection point.
83 (RampController): This controller assumes that the target frame rate is below
84 58 FPS. It runs in two stages. The first stage quickly determines the order of
85 magnitude of objects needed to stress the system by the setting the complexity
86 to increasingly difficult tiers. Perform a series of ramps descending from a
87 high-water mark of complexity. The complexity needed to reach the target frame
88 length is done by performing a piecewise regression on each ramp, and track a
89 running average of these values. For the next ramp, make that running average
90 the center of the ramp. With a minimum complexity of 0, the high-water mark is
91 twice that average. The score is based on the highest complexity that can
94 2016-02-08 Jon Lee <jonlee@apple.com>
96 Address Said's comments on the benchmark, and do some clean up.
98 * Animometer/developer.html:
99 * Animometer/resources/debug-runner/animometer.css: Add styles for averages.
100 * Animometer/resources/debug-runner/animometer.js: Use the right
102 * Animometer/resources/debug-runner/graph.js:
103 (_addRegressionLine): Add missing code to draw the line and standard
105 (onGraphTypeChanged): Remove unneeded variables
106 (onTimeGraphOptionsChanged):
107 * Animometer/resources/runner/benchmark-runner.js:
108 (_runBenchmarkAndRecordResults): Rename samplers to suiteResults and
109 _suitesSamplers to _suitesResults.
110 * Animometer/tests/resources/main.js:
111 (results): Call processSamples().
112 (update): Change sampling timestamp comparison.
113 (_animateLoop): Move shouldStop call to before the update.
114 * Animometer/tests/resources/sampler.js:
115 (process): Rename to processSamples().
117 2016-02-07 Jon Lee <jonlee@apple.com>
119 Teach Controller to measure intervals, and turn off the frame length estimator.
121 * Animometer/tests/resources/main.js: Default interval length is 100 ms.
122 (start): Set the first interval.
123 (_measureAndResetInterval): Reports the average frame length of the interval that just
124 completed, and sets up the next interval.
125 (update): If there is no length, then just use the estimator per frame, otherwise the
126 estimator measures per interval. Add a didFinishInterval for subclasses to process
127 prior to recording the sample. Update tune() to include whether an interval had
129 (StepController): Step controllers don't measure on an interval basis.
131 2016-02-07 Jon Lee <jonlee@apple.com>
133 Minor refactoring. Rename Controller._estimator to Controller._frameLengthEstimator
134 and switch the parameters for start(), update(), and tune(), so that the timestamp
135 is first and stage is second.
137 * Animometer/tests/resources/main.js:
139 2016-02-07 Jon Lee <jonlee@apple.com>
141 Move ResultsTable functionality not needed for release tests out.
142 Move reporting of score and mean to selection of the time-based graph.
144 * Animometer/developer.html: Rename graph-options to time-graph-options.
145 * Animometer/resources/debug-runner/animometer.js:
146 (DeveloperResultsTable): Moved from runner/animometer.js. Switch from mean
147 values to "average" objects which can hold stdev. Move graph button and
148 calculation of noisy measurements here. Sophisticated header processing
149 is not needed in release suite.
150 (populateTable): Use DeveloperResultsTable.
151 * Animometer/resources/debug-runner/graph.js: Pull time graph creation to
152 its own function, and add a new onGraphTypeChanged handler in preparation
153 of a complexity graph to be added later.
154 * Animometer/resources/runner/animometer.js:
155 (ResultsTable): Simplify to just handle test names and scores.
157 2016-02-07 Jon Lee <jonlee@apple.com>
159 Tests: reuse objects already made.
161 Avoid thrash of object creation and removal by maintaining an index that
162 moves along the array as the adjust values change. If the tune value
163 requires more objects than the maximum size of the object array, then create
164 new objects. This means that the object array size never decreases.
166 * Animometer/tests/master/resources/canvas-stage.js: Maintain a separate
167 offsetIndex. For these tests, we want to avoid drawing the oldest objects,
168 so the scene will draw the object at offsetIndex to the end of the array.
169 (tune): Reverse the logic since "removal" of objects is much simpler and
170 involves simply changing the offsetIndex.
171 (animate): Update the for loop to draw from offsetIndex to the end.
172 (complexity): Update the definition.
173 * Animometer/tests/master/resources/canvas-tests.js: Maintain a separate
174 offsetIndex. For these tests, we want to avoid drawing the newest objects,
175 so the scene will draw the object at index 0 to the object at offsetIndex.
176 (SimpleCanvasStage.animate): Fly-by removal of local stage variable,
177 which is unneeded. Update the for loop to draw from offsetIndex to the end.
178 * Animometer/tests/simple/resources/simple-canvas-paths.js:
179 (SimpleCanvasStage.animate): Update the for loop to draw from 0 to
181 * Animometer/tests/simple/resources/simple-canvas.js:
182 (tune): Update logic. Here, offsetIndex represents the boundary of the last
184 (animate): Update the for loop to draw from 0 to offsetIndex.
185 (complexity): Update the definition.
187 2016-02-07 Jon Lee <jonlee@apple.com>
189 Tests: refactor and update styles.
191 * Animometer/tests/resources/main.js: Add helper methods that return
192 a color that hue rotates based on the date, and a counter value that
193 increases based on the date. Fix randomInt() to not bias against the min and
196 * Animometer/tests/master/resources/canvas-tests.js: Use new helper methods.
197 * Animometer/tests/master/resources/dom-particles.js: Ditto.
198 * Animometer/tests/master/resources/particles.js: Ditto.
199 * Animometer/tests/simple/resources/simple-canvas-paths.js: Refactor to
200 use a rotating color instead of a random color. The fast switching of color
201 is too vivid to watch.
203 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
204 (BouncingSvgParticlesStage.call.createGradient): Fix the gradient so
205 that the last stop is located at the end.
207 2016-02-07 Jon Lee <jonlee@apple.com>
209 Refactor tune() to not return the complexity of the scene.
211 We have stage.complexity() now, so returning the complexity through tune
214 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
215 * Animometer/tests/master/resources/canvas-stage.js:
216 * Animometer/tests/master/resources/particles.js:
217 * Animometer/tests/misc/resources/canvas-electrons.js:
218 * Animometer/tests/misc/resources/canvas-stars.js:
219 * Animometer/tests/resources/main.js:
220 * Animometer/tests/simple/resources/simple-canvas.js:
221 * Animometer/tests/simple/resources/tiled-canvas-image.js:
222 * Animometer/tests/template/resources/template-canvas.js:
223 * Animometer/tests/template/resources/template-css.js:
224 * Animometer/tests/template/resources/template-svg.js:
225 * Animometer/tests/text/resources/layering-text.js:
227 2016-02-07 Jon Lee <jonlee@apple.com>
229 Make the fixed controller a step controller instead. Halfway through the test
230 it will bump up the complexity 4-fold. Calculate the step timestamp using options
231 instead of a separate parameter to the Controller constructor.
233 * Animometer/developer.html: Change value to "step"
234 * Animometer/resources/debug-runner/animometer.js:
235 (window.suitesManager.updateEditsElementsState): Show number inputs when set to "step".
236 * Animometer/tests/resources/main.js:
237 (update): Provide a hook for subclasses to tune.
238 (StepController): Maintain a flag determining whether we've stepped, and the time
240 (Benchmark): Use the new StepController.
242 2016-02-07 Jon Lee <jonlee@apple.com>
244 Adjust the FPS graph scale.
246 Instead of making the FPS graph linearly scale, scale it based on the frame length,
247 but show the data in terms of FPS. Because it is inversely proportional, and most
248 of the data never gets below 20, concentrate the axis from 20-60 FPS, since otherwise
249 over half of the available graph space ends up blank.
251 This means we should convert all of the FPS data to frame length data.
253 * Animometer/resources/debug-runner/graph.js: Update the domain to be based on
254 frame length in milliseconds instead of FPS. Update the cursor to consider all of the
255 values being shown, and then pick the min and max values to represent the length of the
257 * Animometer/resources/runner/animometer.js:
258 * Animometer/resources/strings.js:
259 * Animometer/tests/resources/main.js:
260 (processSamples): Add the ability to only sample a range of the data instead of everything
261 after an offset index. Update sampler to record the frame lengths instead of the frame
264 2016-02-07 Jon Lee <jonlee@apple.com>
266 Add option to use different methods for retrieving a timestamp.
268 * Animometer/developer.html: Add performance.now and Date.now options.
269 * Animometer/resources/runner/animometer.js: Default to performance.now.
270 (window.benchmarkController.startBenchmark):
271 * Animometer/tests/resources/main.js: Tie the desired method to _getTimestamp.
272 (run): Use _getTimestamp.
273 (_animateLoop): Ditto.
275 2016-02-07 Jon Lee <jonlee@apple.com>
277 Allow adding any number of markers to the graph. The markers can be labeled
278 and contain timestamp and sample index data. Make it a part of the controller
279 rather than keeping it in the sampler.
281 * Animometer/resources/debug-runner/animometer.css: Add styles for markers
282 * Animometer/resources/debug-runner/graph.js: Create the markers and add
284 * Animometer/resources/runner/animometer.js: Assume the samplingTimeOffset
285 is just one of the marks provided.
286 * Animometer/resources/strings.js: Add Strings.json.marks.
287 * Animometer/tests/resources/main.js:
288 (Controller): Keep marks here. They are keyed by the marker name, so no two
289 markers should have the same name.
290 (recordFirstSample): Refactor to use mark.
291 (mark): Allows for arbitrary data if needed later. The timestamp maintained
292 is relative to the absolute start timestamp.
293 (containsMark): Checks whether a mark with a specific comment exists.
294 (processSamples): Removes the _startTimestamp offset from the marks before
295 setting it in results.
296 * Animometer/tests/resources/sampler.js: Remove marks.
298 2016-02-07 Jon Lee <jonlee@apple.com>
300 Get rid of options member variable in Benchmark.
302 Options are only needed when initializing the stage or benchmark, so there's no
303 need to also keep a reference to it.
305 * Animometer/tests/resources/main.js: Get rid of options variable in Benchmark.
306 Pass options to Controllers and Stages.
307 (Controller.Utilities.createClass):
308 (Benchmark.Utilities.createClass):
309 (get options): Deleted.
311 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
312 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
313 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
314 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
315 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
316 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
317 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
318 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
319 * Animometer/tests/master/resources/canvas-stage.js:
320 * Animometer/tests/master/resources/canvas-tests.js:
321 * Animometer/tests/master/resources/particles.js:
322 * Animometer/tests/misc/resources/canvas-electrons.js:
323 * Animometer/tests/misc/resources/canvas-stars.js:
324 * Animometer/tests/misc/resources/compositing-transforms.js:
325 * Animometer/tests/simple/resources/simple-canvas-paths.js:
326 * Animometer/tests/simple/resources/tiled-canvas-image.js:
327 * Animometer/tests/template/resources/template-canvas.js:
328 * Animometer/tests/template/resources/template-css.js:
329 * Animometer/tests/template/resources/template-svg.js:
330 * Animometer/tests/text/resources/layering-text.js:
332 2016-02-07 Jon Lee <jonlee@apple.com>
334 Update how the benchmark is run
335 https://bugs.webkit.org/show_bug.cgi?id=153960
337 Provisionally reviewed by Said Abou-Hallawa.
339 Introduce the notion of a Controller. It is responsible for recording, updating,
340 and processing the statistics and complexity of the benchmark. This allows
341 plugging in different Controllers.
343 This strips most of the functionality from Animator and BenchmarkState, so fold
344 what's left into Benchmark. Now, Benchmarks only own a stage and a controller, but
345 are responsible for driving the animation loop.
347 Rewrite Animator._shouldRequestAnotherFrame into two different Controllers. One
348 maintains a fixed complexity, and the other adapts the complexity to meet a
351 Fix the Kalman estimator to be modeled on a scalar variable with no model.
353 * Animometer/tests/resources/main.js: Remove BenchmarkState and Animator, and
354 replace it with a Controller. Add a FixedController and refactor the previous controller
355 to an AdaptiveController.
357 (Controller): Controllers own the estimator and the sampler. When a new frame is
358 displayed, the animation loop calls update(). The estimator and sampler record
359 stats, then tune. Samplers can track multiple series of data. The basic controller
360 tracks timestamp, complexity, and estimated frame rate.
361 The Kalman estimation is based on the frame length rather than the frame
362 rate. Because FPS is inverse proportional to frame length, in the case where the measured
363 frame length is very small, the FPS ends up being a wildly large number (in the order of
364 600-1000 "FPS"), and it pulls the estimator up drastically enough that it takes a while
365 for it to settle back down. Using frame length reduces the impact of these spikes.
366 Converging the estimation takes enough time to avoid initializing it immediately
367 when the benchmark starts. Instead, the benchmark runs for a brief period of time (100ms)
368 before running it in earnest. Allow controllers an opportunity to set the complexity
369 before starting recording.
370 When the benchmark is complete, the controller has an opportunity to process
371 the samples. The default implementation calculates the raw FPS based on the time
372 difference of the samples, and calculates the complexity score. This is moved from
373 Benchmark.processSamples.
375 (Controller): Initialize timestamps. These are at first relative to the start of the
376 benchmark, but are offset by the absolute start time during start(). By default maintain
377 3 data series, but subclasses can override.
378 (start): Calls recordFirstSample() for subclasses to override if needed.
379 (recordFirstSample): For basic controller, start sampling at the beginning.
380 (update): Update the frame length estimator and sample.
381 (shouldStop): Checks that the time is before _endTimestamp.
382 (results): Returns the processed samples.
383 (processSamples): Iterate through the sample data and collate them. Include scores.
385 (FixedComplexityController): Controller that tunes the stage to the desired complexity
386 prior to starting, and keeps it at that complexity.
388 (AdaptiveController): Have the estimator estimate the interval frame rate instead of the
390 The previous version of this controller ignored the frame that came after the
391 adjustment. The raw FPS show that whatever noise the scene change adds is negligible
392 compared to the noise of the system overall. Stop ignoring that frame and include all
393 frames in the measurements.
395 (Benchmark): Remove dependency on animator, and instantiate a runner based on what is
396 selected. Most of the loop's functionality is in Controller, so remove here.
397 (Benchmark.run): Remove start() since it is only called from run(), and fold it in here.
398 (Benchmark._animateLoop): Fold in from Animator.animateLoop. Let the benchmark run for
399 a brief period before calling Controller.start().
401 * Animometer/tests/resources/math.js: Fix the Kalman estimator. The filter estimates
402 a scalar variable, and makes basic assumptions regarding the model. As a result
403 none of the linear algebra classes are needed, so remove Matrix, Vector3, and Matrix3.
404 (SimpleKalmanEstimator): Calculate the gain based on the provided process and
406 (KalmanEstimator): Deleted.
407 (IdentityEstimator): Deleted.
408 (PIDController): Refactor to use the Utilities.createClass() helper.
410 The Kalman filter algorithm is explained here http://greg.czerniak.info/guides/kalman1/.
411 The state, represented by a scalar, is the estimated frame length. There is no user
412 transition of the state, and the state is the same as the measurement. With this model,
413 the estimation error converges, so calculate the gain ahead of time.
415 * Animometer/developer.html: Remove fixed-after-warmup since it is not useful.
416 Replace the option to toggle the estimator, and make it possible to customize the
417 estimator's error parameters. Show raw FPS by default, and remove interval FPS,
418 which will be shown instead of the filtered raw FPS.
419 * Animometer/resources/debug-runner/animometer.css: Put the header behind the graph.
420 Remove #intervalFPS rules; move the color to #filteredFPS.
421 * Animometer/resources/debug-runner/graph.js:
422 (updateGraphData): Update the hr style to force the layout to be calculated
423 correctly. Change the tick format to be in terms of seconds, since the timestamps
424 are in milliseconds. Remove interval data.
425 * Animometer/resources/runner/animometer.js:
426 (window.benchmarkController.startBenchmark): Set Kalman parameters.
427 * Animometer/resources/runner/benchmark-runner.js:
428 (_runBenchmarkAndRecordResults): When a benchmark completes, expect it to return
429 the final data, rather than passing a sampler from the controller. This avoids
430 needing to expose the sampler variable in the benchmark.
431 * Animometer/tests/resources/sampler.js:
432 (process): Move the setting of the target frame rate to AdaptiveController.
434 2016-02-06 Jon Lee <jonlee@apple.com>
436 Code clean up: Move Rotater function closer to Stage static methods.
437 The Rotater is used together with those methods; keep them close.
439 * Animometer/tests/resources/main.js:
441 2016-02-06 Jon Lee <jonlee@apple.com>
443 Update the JS includes due to ResultsTable move.
445 * Animometer/developer.html:
446 * Animometer/index.html:
448 2016-02-06 Jon Lee <jonlee@apple.com>
450 Move createElement and createSVGElement to Utilities.
452 * Animometer/resources/extensions.js:
453 (Utilities.createElement): Added.
454 (Utilities.createSVGElement): Added.
455 (DocumentExtension.createElement): Deleted.
456 (DocumentExtension.createSvgElement): Deleted.
458 * Animometer/resources/debug-runner/animometer.js:
459 * Animometer/resources/runner/animometer.js:
460 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
461 * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
462 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
464 2016-02-06 Jon Lee <jonlee@apple.com>
466 Add a convenience function for creating a class.
468 The pattern for creating a class is common enough to add as a Utilities
469 helper function. It also makes it easy to collapse class definitions when
472 * Animometer/resources/debug-runner/animometer.js: Move ProgressBar definition,
473 since it is only used here.
474 * Animometer/resources/runner/animometer.js: Move ResultsDashboard and
475 ResultsTable definition, since it is only used here.
476 * Animometer/resources/extensions.js: Move Utilities definition to the top. Convert
477 Point, Insets, SimplePromise.
478 (ProgressBar): Moved to animometer.js.
479 (ResultsDashboard): Moved to animometer.js.
480 (ResultsTable): Moved to animometer.js.
481 * Animometer/resources/runner/benchmark-runner.js: Convert BenchmarkRunnerState,
483 * Animometer/tests/resources/main.js: Convert Rotater, Stage, Animator, Benchmark.
484 * Animometer/tests/resources/sampler.js: Convert Experiment, Sampler.
486 Convert test primitives.
487 * Animometer/tests/master/resources/canvas-tests.js: Convert CanvasLineSegment,
488 CanvasArc, CanvasLinePoint.
489 * Animometer/tests/simple/resources/simple-canvas-paths.js: Convert CanvasLineSegment,
490 CanvasLinePoint, CanvasQuadraticSegment, CanvasQuadraticPoint, CanvasBezierSegment,
491 CanvasBezierPoint, CanvasArcToSegment, CanvasArcToSegmentFill, CanvasArcSegment,
492 CanvasArcSegmentFill, CanvasRect, CanvasRectFill.
493 * Animometer/tests/simple/resources/tiled-canvas-image.js: Convert CanvasImageTile.
495 2016-02-06 Jon Lee <jonlee@apple.com>
497 Minor improvements to debug harness.
499 * Animometer/developer.html:
500 * Animometer/resources/debug-runner/animometer.css:
501 (#suites): Put the complexity text boxes closer to the test names.
503 (#rawFPS circle): Make the interval FPS appear as a separate data series, with a line.
505 (#intervalFPS circle):
506 * Animometer/resources/debug-runner/animometer.js:
507 (window.optionsManager.updateLocalStorageFromUI): Convert number inputs from text.
508 (window.suitesManager._onChangeTestCheckbox): Refactor to take a checkbox.
509 (window.suitesManager._createTestElement): Enhance such that typing into the complexity
510 input will automatically select that test for running.
511 (window.suitesManager.updateLocalStorageFromJSON): Make the harness work for private
513 * Animometer/resources/debug-runner/graph.js: Separate the intervalFPS data, and show
514 more accuracy in timestamps.
516 2016-02-06 Jon Lee <jonlee@apple.com>
518 Refactor helper methods for getting random values for a stage.
520 Instead of requiring a Stage instance, just attach it to the Stage object.
522 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
523 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
524 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
525 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
526 * Animometer/tests/master/resources/canvas-tests.js:
527 * Animometer/tests/master/resources/particles.js:
528 * Animometer/tests/misc/resources/canvas-electrons.js:
529 * Animometer/tests/misc/resources/canvas-stars.js:
530 * Animometer/tests/misc/resources/compositing-transforms.js:
531 * Animometer/tests/resources/main.js:
532 * Animometer/tests/simple/resources/simple-canvas-paths.js:
534 2016-02-05 Said Abou-Hallawa <sabouhallawa@apple.com>
536 Add a new graphics test for CanvasRenderingContext2D functions: getImageData and putImageData
537 https://bugs.webkit.org/show_bug.cgi?id=151716
539 Reviewed by Darin Adler.
541 The purpose of this test is to measure the performance of getImageData
542 and putImageData functions. This test draws a background on the canvas
543 and then gets some random tiles from this background and draw them in
544 destinations different from their original sources.
546 * Animometer/resources/debug-runner/tests.js: Adding the new test to the canvas simple tests suite.
548 * Animometer/resources/extensions.js:
549 (Array.prototype.shuffle): Shuffles the elements of an array.
551 (Point.zero): Returns a new Point object whose x and y are equal zero.
552 (Point.prototype.str): Used for debugging the Point object.
554 * Animometer/tests/simple/resources/tiled-canvas-image.js: Added.
556 (CanvasImageTile.prototype.getImageData):
557 (CanvasImageTile.prototype.putImageData):
558 (Stage.call.initialize):
559 (Stage.call._createTiles):
560 (Stage.call._nextTilePosition):
562 (Stage.call._drawBackground):
563 (Stage.call.animate):
564 (Stage.call.complexity):
566 * Animometer/tests/simple/tiled-canvas-image.html: Added.
568 2016-01-07 Jon Lee <jonlee@apple.com>
572 * Animometer/resources/runner/tests.js: Wrong URL from an
574 * Animometer/tests/master/particles.html:
575 * Animometer/tests/master/resources/dom-particles.js:
576 (Particle.call.reset): Figured out a simpler way to set up
578 (this.move.reset): Deleted.
579 (this.move._applyAttributes): Deleted.
580 * Animometer/tests/master/resources/particles.js:
581 (Particle): Call move() after reset().
583 2016-01-07 Jon Lee <jonlee@apple.com>
585 Update benchmark test suite
586 https://bugs.webkit.org/show_bug.cgi?id=152679
588 Reviewed by Simon Fraser.
590 Add a new test. The test has a rotating background
591 gradient, and does a better job physically simulating
594 * Animometer/resources/extensions.js: Teach Point to take constants as well as other Points.
595 (Point.prototype.length): Added.
596 (Point.prototype.normalize): Added.
597 * Animometer/resources/runner/tests.js: Add the test to the master suite.
598 * Animometer/tests/master/particles.html: Added.
599 * Animometer/tests/master/resources/particles.js: Added. Parent class for different kinds of particles.
601 (Particle.prototype.reset): If the particle starts slowing down in terms of its animation,
603 (Particle.prototype.animate): Bounce off the walls elastically, and include gravity.
604 (Particle.prototype.move): Subclasses should override.
605 (ParticlesStage): Stage includes a rotating gradient background.
606 * Animometer/tests/master/resources/dom-particles.js: Added. Creates a <div> and adds it to
608 * Animometer/tests/resources/star.svg: Added.
610 2016-01-03 Jon Lee <jonlee@apple.com>
612 Update benchmark test suite
613 https://bugs.webkit.org/show_bug.cgi?id=152679
615 Reviewed by Simon Fraser.
617 Move algorithm.js and sampler.js to tests/ and benchmark-runner.js to runner/.
619 Needed by both harnesses.
620 * Animometer/resources/runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/resources/debug-runner/benchmark-runner.js.
621 * Animometer/developer.html:
622 * Animometer/index.html:
624 Needed only by the tests. Move to tests/. Statistics, in sampler.js, is used by ResultsDashboard, so move that
626 * Animometer/resources/extensions.js:
627 * Animometer/tests/resources/algorithm.js: Renamed from PerformanceTests/Animometer/resources/algorithm.js.
628 * Animometer/tests/resources/sampler.js: Renamed from PerformanceTests/Animometer/resources/sampler.js.
629 * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
630 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
631 * Animometer/tests/bouncing-particles/bouncing-css-images.html:
632 * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
633 * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
634 * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
635 * Animometer/tests/master/canvas-stage.html:
636 * Animometer/tests/misc/canvas-electrons.html:
637 * Animometer/tests/misc/canvas-stars.html:
638 * Animometer/tests/misc/compositing-transforms.html:
639 * Animometer/tests/simple/simple-canvas-paths.html:
640 * Animometer/tests/template/template-canvas.html:
641 * Animometer/tests/template/template-css.html:
642 * Animometer/tests/template/template-svg.html:
643 * Animometer/tests/text/layering-text.html:
644 * Animometer/tests/text/text-boxes.html:
646 2016-01-07 Jon Lee <jonlee@apple.com>
648 Update benchmark test suite
649 https://bugs.webkit.org/show_bug.cgi?id=152679
651 Reviewed by Simon Fraser.
653 Fix tests for other browsers.
655 * Animometer/resources/extensions.js:
656 (Point.elementClientSize): Some browsers return 0 for SVG clientWidth and clientHeight.
657 Use getBoundingClientRect() instead.
658 * Animometer/tests/misc/resources/canvas-electrons.js:
659 (CanvasElectron.prototype._draw): Some browsers don't support ellipse.
661 2016-01-07 Jon Lee <jonlee@apple.com>
663 Add a waitUntilReady() step
664 https://bugs.webkit.org/show_bug.cgi?id=152862
666 Reviewed by Simon Fraser.
668 Add a waitUntilReady() callback that lets the benchmark complete
669 its setup before running the benchmark.
671 * Animometer/tests/resources/main.js:
672 (Benchmark.prototype.run): First call waitUntilReady, which returns
673 a promise. When the promise resolves, run everything that was in this
675 (Benchmark.prototype.waitUntilReady): Default implementation returns
677 (Benchmark.prototype.resolveWhenFinished): Deleted.
678 * Animometer/tests/template/resources/template-canvas.js:
679 (new.TemplateCanvasStage.waitUntilReady): Example on how to override.
681 2016-01-03 Jon Lee <jonlee@apple.com>
683 Update data reporting and analysis
684 https://bugs.webkit.org/show_bug.cgi?id=152670
686 Reviewed by Simon Fraser.
688 Show new graph data. Provide controls to show different series data. Provide an
689 interactive cursor that shows the data at a given sample.
691 * Animometer/developer.html: Add a nav section in #results. Each part of the graph
692 has a checkbox for visual toggling, as well as companion spans to contain the data.
693 The numbers will always be shown even if the SVG isn't.
694 * Animometer/resources/debug-runner/animometer.css:
695 (#suites): Adjust spacing when doing fixed complexity.
696 (#test-graph nav): Place the nav in the upper right corner.
697 (#test-graph-data > svg): Fix the FPS scale from 0-60. It makes the raw FPS goes past
698 that scale. Allow it to show.
699 (.target-fps): Add a dotted line for where the benchmark is supposed to settle for FPS.
700 (#cursor line): The cursor contains a line and highlight circles for the data being shown.
702 (#complexity path): This and rules afterward are named by series type.
703 (#complexity circle):
705 (#filteredFPS circle):
707 (#intervalFPS circle):
708 (.left-samples): Deleted.
709 (.right-samples): Deleted.
710 * Animometer/resources/debug-runner/animometer.js:
711 (initialize): Add a "changed" listener when the checkboxes change in the nav.
712 (onBenchmarkOptionsChanged): Renamed.
713 (showTestGraph): All graph data is passed in as graphData instead of as arguments.
714 * Animometer/resources/debug-runner/graph.js: Extend BenchmarkController. When showing
715 a new graph, call updateGraphData(). It creates all of the d3 graphs. onGraphOptionsChanged()
716 toggles the data on and off.
717 (updateGraphData): Add the axes. Add the average lines and markers for sample time and
718 target FPS. Add the cursor group. Use helper function addData() to add the data. On top of
719 everything add a transparent area which will catch all of the mouse events. When the mouse
720 moves in the graph, find the closest data point, show the data in the nav area, and highlight
722 (addData): Adds a line and circle for each data point. Also adds a highlight cursor with a
723 size a little larger than the circle radius for the data points.
724 (onGraphOptionsChanged): Called when data is visually toggled.
725 (showOrHideNodes): Helper function to toggle the .hidden class.
726 * Animometer/resources/extensions.js:
727 (ResultsDashboard.prototype.get data): Get rid of the arguments for _processData.
728 (ResultsTable.prototype._addGraphButton): Shove all of the graph data into a singular object.
730 Producing the JSON can take a while with all of the data. Make it on-demand with a
733 * Animometer/resources/debug-runner/animometer.js:
734 (showResults): When showing the results, don't serialize the JSON data. Move that to...
735 (showJSONResults): ...here. Remove the button.
737 * Animometer/developer.html: Add a button. The button will remove itself and populate
738 the textarea with the JSON data.
739 * Animometer/resources/debug-runner/animometer.css:
740 (.hidden): Add a universal hidden class.
741 (#results button.small-button): Promote the small-button styles to the whole results
742 section for use in the JSON button.
743 (#results button.small-button:active):
744 (#results-data button.small-button): Deleted.
745 (#results-data button.small-button:active): Deleted.
747 Refactor how Animator does its recording.
749 * Animometer/tests/resources/math.js: Create a new, simple estimator that just returns
750 the same interval frame rate for adjustment.
751 * Animometer/tests/resources/main.js:
752 (Animator): Remove _dropFrameCount, and make variables more accurate described.
753 (Animator.prototype.initialize): Use the identity estimator instead of using a bool.
754 (Animator.prototype._intervalTimeDelta): Rename, only used internally.
755 (Animator.prototype._shouldRequestAnotherFrame): Assume we drop one frame for adjustment
756 of the scene. If we are within the number of frames to measure for the interval, just
757 record the timestamp. Otherwise we are ready to evaluate and adjust the scene. Record
758 the interval frame rate and the estimator's frame rate.
760 Avoid processing the data through the Experiment while the test is running. Reconfigure
761 the sampler to just record the raw samples. After the test is done, run the samples through
762 the Experiment to get the score.
764 * Animometer/resources/sampler.js:
765 (Experiment): Fold _init() into the constructor since nobody else will call it. This is not
766 needed until the test concludes, so remove startSampling(). Clients should just call sample().
767 (Sampler): Pre-allocate arrays given the number of data points being recorded, and a capacity
768 of how many samples will be used. The processor is a called when it's time to process the data
769 since that is the client also telling the Sampler what to record.
770 Introduce the notion of marks as well, which allows the client to mark when an
771 event occurs. When we mark sample start, we can attach the timestamp there, instead of storing
773 (Sampler.prototype.startSampling): Deleted. Clients should just call record().
774 (Sampler.prototype.record): The data to record is passed in as variable arguments.
775 (Sampler.prototype.mark): When adding a mark, a client needs to provide a unique string, and
776 can provide extra data object for later retrieval.
777 (Sampler.prototype.process): Renamed from toJSON. Trim the sampling arrays to what was used.
778 Call the processor to process the samples.
779 * Animometer/resources/debug-runner/benchmark-runner.js:
780 (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Call process().
782 * Animometer/resources/strings.js: Add some new strings, remove the graph ones since they are
784 * Animometer/tests/resources/main.js:
785 (Benchmark): Create a sampler with 4 series. The maximum number of points expected is the
786 number of seconds multiplied by 60 fps. Benchmark, as a client of the Sampler, knows about all
787 of the data being added to the Sampler. It is added through record(), and processed through
789 (Benchmark.prototype.update): Mark when we've passed warmup and are starting to sample. Include
790 the timestamp in the custom data for the mark. This avoids the need to store is separately in
791 the Sampler. Fold what was in record() here, since nothing else needs this functionality.
792 record() now just relays the information to the sampler.
793 (Benchmark.prototype.record): Called by Animator, which provides the data to the sampler.
794 Animator's calls to this is part of a later patch. Requires each stage to return its complexity.
795 (Benchmark.prototype.processSamples): If the sampling mark exists, add it to the results.
796 Go through all of the samples. All samples contain a timestamp and complexity. We
797 calculate "raw FPS" which is the time differential from the previous sample. At regular intervals
798 the Kalman-filtered FPS and the interval average FPS are also recorded. We also create two
799 experiments, to get the scores for the complexity and smoothed FPS, and add those samples to
800 the experiments. Grab those scores and add them into results also.
802 Add complexity() to the tests for Benchmark.record().
803 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
804 * Animometer/tests/misc/resources/canvas-electrons.js:
805 * Animometer/tests/misc/resources/canvas-stars.js:
806 * Animometer/tests/text/resources/layering-text.js:
808 2015-12-27 Jon Lee <jonlee@apple.com>
810 Simplify the test harness
811 https://bugs.webkit.org/show_bug.cgi?id=152562
813 Reviewed by Simon Fraser.
815 Update the simple canvas tests. For the paths, start from the center instead of the
816 top-left corner. Instead of using a coordinate limit, use a canonized factor, and
817 use that along both the x and y axes, so that more capable tests use more of the
820 * Animometer/tests/simple/resources/simple-canvas-paths.js:
821 (CanvasLinePoint): Rewrite to use the coordinate maximum factor.
822 (CanvasQuadraticPoint): Ditto.
823 (CanvasBezierPoint): Ditto.
824 * Animometer/tests/simple/resources/simple-canvas.js:
825 (tune): Calculate a factor instead of a maximum coordinate.
827 2015-12-27 Jon Lee <jonlee@apple.com>
829 Simplify the test harness
830 https://bugs.webkit.org/show_bug.cgi?id=152562
832 Reviewed by Simon Fraser.
834 All of the benchmarks use the default Animator(). Don't require new tests
835 to pass a new instance, and instead just make one in the Benchmark constructor.
837 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
838 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
839 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
840 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
841 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
842 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
843 * Animometer/tests/master/resources/canvas-tests.js:
844 * Animometer/tests/misc/resources/canvas-electrons.js:
845 * Animometer/tests/misc/resources/canvas-stars.js:
846 * Animometer/tests/misc/resources/compositing-transforms.js:
847 * Animometer/tests/resources/main.js:
848 * Animometer/tests/simple/resources/simple-canvas-paths.js:
849 * Animometer/tests/template/resources/template-canvas.js:
850 * Animometer/tests/template/resources/template-css.js:
851 * Animometer/tests/template/resources/template-svg.js:
852 * Animometer/tests/text/resources/layering-text.js:
853 * Animometer/tests/text/resources/text-boxes.js:
855 Refactor the template.
857 * Animometer/tests/template/resources/template-canvas.js:
858 * Animometer/tests/template/resources/template-css.js:
859 * Animometer/tests/template/resources/template-svg.js:
860 * Animometer/tests/template/template-canvas.html:
861 * Animometer/tests/template/template-css.html:
862 * Animometer/tests/template/template-svg.html:
864 Refactor the SVG suite.
866 * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Move scripts to the end.
867 * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
869 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Remove extraneous includes
871 * Animometer/tests/text/text-boxes.html: Ditto.
873 BouncingCanvasParticlesBenchmark is not necessary. Use Benchmark directly when subclassing.
874 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Remove
875 BouncingCanvasParticlesBenchmark.
876 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Use Benchmark.
877 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Ditto.
879 * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Require the shape
880 in the constructor instead of having subclasses set the private variable.
882 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Refactor.
883 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
885 Refactor the HTML suite.
887 Move scripts to the end.
888 * Animometer/tests/bouncing-particles/bouncing-css-images.html:
889 * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
890 * Animometer/tests/text/layering-text.html:
891 * Animometer/tests/text/text-boxes.html:
893 Refactor to use the new variables.
894 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
895 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
896 * Animometer/tests/text/resources/layering-text.js:
897 * Animometer/tests/text/resources/text-boxes.js:
899 Refactor the bouncing canvas tests.
901 * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Move scripts to the end.
902 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Move scripts to the end.
904 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Promote a few
905 properties to "public" since they are used by subclasses.
906 (BouncingParticlesStage): Fix the constructor, which was missing "this". Make particles
907 "public" for subclasses.
908 (BouncingParticlesStage.initialize): Fix the max velocity, which was accidentally changed.
909 * Animometer/tests/misc/resources/compositing-transforms.js: Refactor.
911 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
912 BouncingCanvasParticlesAnimator is no longer needed.
913 (BouncingCanvasParticle): Change constructor to take a shape as a parameter instead of
914 having subclasses set the variable.
916 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Refactor.
917 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Refactor.
919 Move example/ files into misc/.
921 * Animometer/tests/misc/canvas-electrons.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-electrons.html.
922 * Animometer/tests/misc/canvas-stars.html: Renamed from PerformanceTests/Animometer/tests/examples/canvas-stars.html.
923 * Animometer/tests/misc/resources/canvas-electrons.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-electrons.js.
924 * Animometer/tests/misc/resources/canvas-stars.js: Renamed from PerformanceTests/Animometer/tests/examples/resources/canvas-stars.js.
926 * Animometer/resources/debug-runner/tests.js: Update test URLs.
928 Refactor miscellaneous suite.
930 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
931 Remove BouncingParticlesAnimator and BouncingParticleBenchmark, which are
933 (tune): Remove console assert.
934 * Animometer/tests/resources/main.js: Add Rotater back in from stage.js.
936 * Animometer/tests/examples/resources/canvas-electrons.js: Remove CanvasElectronsAnimator.
937 * Animometer/tests/examples/resources/canvas-stars.js: Remove CanvasStarsAnimator.
938 * Animometer/tests/misc/resources/compositing-transforms.js:
939 * Animometer/tests/examples/canvas-electrons.html: Move scripts to the end.
940 * Animometer/tests/examples/canvas-stars.html: Ditto.
941 * Animometer/tests/misc/compositing-transforms.html: Ditto.
943 Refactor the simple suite.
945 * Animometer/tests/master/resources/canvas-stage.js:
946 (tune): Remove coordinateMaximum since it is not needed in any
948 * Animometer/tests/simple/resources/simple-canvas.js:
949 SimpleCanvasAnimator and SimpleCanvasBenchmark are no longer
951 (tune): Manage the objects differently, but instead of duplicating
952 all of SimpleCanvasStage here, just replace tune(). Include
953 coordinateMaximum, and remove items from the end of the list
954 instead of the beginning.
955 (StageBenchmark.call.createAnimator): Deleted.
956 (StageBenchmark.call): Deleted.
957 * Animometer/tests/simple/resources/simple-canvas-paths.js:
958 * Animometer/tests/simple/simple-canvas-paths.html: Move
961 Get rid of stage.js, StageAnimator, and StageBenchmark. Don't have the progress bar update during the test.
963 * Animometer/resources/debug-runner/animometer.js:
964 (initialize): Move the setting of testsCount to the debug runner.
965 (didRunTest): Nicer name.
966 * Animometer/resources/debug-runner/benchmark-runner.js:
967 (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Don't pass in the progress bar to benchmarks.
968 * Animometer/resources/extensions.js:
969 (ProgressBar): Refactor. Make variables "private". Resetting the progress when instantiating.
970 (ProgressBar.prototype.incrementRange): This is called every time a benchmark completes.
971 * Animometer/resources/runner/animometer.js:
972 (window.benchmarkRunnerClient.initialize): Remove unneeded setting of testsCount.
973 * Animometer/resources/strings.js: These are no longer needed.
974 * Animometer/tests/master/canvas-stage.html: Remove script inclusion. Other tests will follow.
975 * Animometer/tests/master/resources/canvas-tests.js: Use Benchmark instead of StageBenchmark.
976 * Animometer/tests/resources/main.js: Messages are no longer needed
977 (Animator.prototype._shouldRequestAnotherFrame): Rename from animate(), since this method returns a boolean
978 indicating whether another frame should be requested. Collapse the logic from StageAnimator into animateLoop.
979 (BenchmarkState.prototype.currentStage): Deleted.
980 (BenchmarkState.prototype.currentMessage): Deleted.
981 (BenchmarkState.prototype.currentProgress): Deleted.
982 (Animator.prototype.animate): Deleted.
983 (Animator.prototype.animateLoop): The stage is animated only when we have another frame to draw.
984 (Benchmark.prototype.record): No need to update the progress bar.
985 * Animometer/tests/resources/stage.js: Removed. Rotater will appear in a later patch, in main.js.
987 * Animometer/resources/debug-runner/benchmark-runner.js:
988 (BenchmarkRunner.prototype._runBenchmarkAndRecordResults): Each test is run as a benchmark.
989 Remove the call to runBenchmark by merging the options here, and calling benchmark.run()
992 Make the class relationships more easily understandable. The benchmark owns the stage,
993 animator, and options. Make the stage and animator no longer have their own references to
994 the options. Make Stage a first-class citizen by promoting it to main.js. Later patches
995 will try to get rid of stage.js altogether.
996 * Animometer/tests/resources/main.js:
997 (Stage): Moved from stage.js.
998 (Animator): Don't pass in benchmark and options in its constructor. It will get initialized
999 by benchmark-related parameters in initialize().
1000 (Animator.prototype.initialize): Add a back-reference to benchmark and cache an option.
1001 (Animator.prototype.get benchmark):
1002 (Animator.prototype.animate): Refactor to use the cached option, to remove its dependency on
1003 the options dictionary.
1004 (Benchmark): Require all benchmarks to have a stage and animator. The instance will initialize
1006 (Benchmark.prototype.get options):
1007 (Benchmark.prototype.get stage): BenchmarkStates.stages will need to be renamed to avoid confusion.
1008 (Benchmark.prototype.get animator):
1009 (Benchmark.prototype.start):
1010 (Benchmark.prototype.update): Ask the stage directly to tune or clear instead of adding another
1011 level of indirection.
1012 (window.runBenchmark): Deleted. Remove the need for a benchmarkClient. Also remove the standalone
1013 path, since tests can be individually selected, and remove the need for runBenchmark since that is
1014 handled in BenchmarkRunner._runBenchmarkAndRecordResults.
1015 * Animometer/tests/resources/stage.js:
1016 (Stage): Deleted. Moved to main.js.
1017 (StageBenchmark): What's left is updating the progress bar; to be removed.
1018 (StageAnimator): What's left can be folded in Animator.
1020 Refactor master suite.
1021 * Animometer/tests/master/resources/canvas-stage.js: This now only has SimpleCanvasStage.
1022 (animate): Push the clearRect() into each stage.
1024 (StageBenchmark.call.createAnimator): Deleted.
1025 (StageBenchmark.call): Deleted.
1026 * Animometer/tests/master/resources/canvas-tests.js: SimpleCanvasPathStrokeStage is no longer needed.
1027 (CanvasLineSegment.prototype.draw):
1029 (CanvasLinePoint): Remove the draw call because depending on its index it either needs to be moveTo
1030 or lineTo, and it is otherwise a very small draw operation that doesn't need the overhead of the
1031 function call. Do all of the drawing through the stage.
1033 Refactor the subclass pattern. Introduce Utilities.createSubclass().
1035 * Animometer/resources/debug-runner/benchmark-runner.js:
1036 * Animometer/resources/extensions.js:
1037 (window.Utilities.createSubclass): Takes the super class, a function representing
1038 the class's constructor, and additional methods to attach to the new class's
1040 * Animometer/tests/text/text-boxes.html: Remove unneeded reference to utilities.js.
1043 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1044 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1045 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1046 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1047 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1048 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1049 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1050 * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
1051 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1052 * Animometer/tests/examples/resources/canvas-electrons.js:
1053 * Animometer/tests/examples/resources/canvas-stars.js:
1054 * Animometer/tests/master/resources/canvas-stage.js:
1055 * Animometer/tests/master/resources/canvas-tests.js:
1056 * Animometer/tests/misc/resources/compositing-transforms.js:
1057 * Animometer/tests/resources/stage.js:
1058 * Animometer/tests/simple/resources/simple-canvas-paths.js:
1059 * Animometer/tests/simple/resources/simple-canvas.js:
1060 * Animometer/tests/template/resources/template-canvas.js:
1061 * Animometer/tests/template/resources/template-css.js:
1062 * Animometer/tests/template/resources/template-svg.js:
1063 * Animometer/tests/text/resources/layering-text.js: Reorder some of the methods
1064 and properties since they rely on each other.
1065 * Animometer/tests/text/resources/text-boxes.js:
1067 * Animometer/resources/debug-runner/animometer.js: Arrange calls
1068 in the order they are evoked.
1069 * Animometer/resources/debug-runner/benchmark-runner.js:
1070 (BenchmarkRunnerState.prototype.next): Get rid of return value since
1071 no caller to next() uses it.
1072 (BenchmarkRunnerState.prototype.prepareCurrentTest): Refactor the
1073 promise to resolve simply when onload() is called instead of
1075 (BenchmarkRunner.prototype._runTestAndRecordResults): Suite.run
1076 simply calls runBenchmark(). Call it directly rather than through
1078 (BenchmarkRunner.prototype.step): Remove unused parameter in
1080 (BenchmarkRunner.prototype.runMultipleIterations): Use this instead
1081 of self since it is outside of the closure which needed the self
1083 (resolveIfReady): Deleted.
1084 (BenchmarkRunner.prototype.waitForElement): Deleted.
1085 * Animometer/resources/runner/tests.js: prepare() and run() are
1087 (Suite.prototype.prepare): Deleted.
1088 (Suite.prototype.run): Deleted.
1089 * Animometer/tests/master/canvas-stage.html: Move all scripts to
1090 the end of the page.
1092 2015-12-23 Simon Fraser <simon.fraser@apple.com>
1094 Add an Animometer developer test which animates text-rich boxes
1095 https://bugs.webkit.org/show_bug.cgi?id=152544
1097 Reviewed by Zalan Bujtas.
1099 Add a test that draws lots of international text. This is a particle test,
1100 moving the boxes around with absolution positioning.
1102 * Animometer/resources/debug-runner/tests.js:
1103 * Animometer/tests/text/resources/text-boxes.js: Added.
1105 (BouncingTextBox.prototype._move):
1106 (BouncingTextBox.prototype.animate):
1107 (BouncingTextBoxStage):
1108 (BouncingTextBoxStage.prototype.createParticle):
1109 (BouncingTextBoxStage.prototype.particleWillBeRemoved):
1110 (BouncingTextBoxsBenchmark):
1111 (BouncingTextBoxsBenchmark.prototype.createStage):
1112 (window.benchmarkClient.create):
1113 * Animometer/tests/text/text-boxes.html: Added.
1115 2015-12-23 Jon Lee <jonlee@apple.com>
1117 Split benchmark into two different pages
1118 https://bugs.webkit.org/show_bug.cgi?id=152458
1120 Reviewed by Simon Fraser.
1122 Add tests to 'animometer' suite.
1124 * Animometer/resources/runner/tests.js:
1125 * Animometer/tests/master/canvas-stage.html: Added.
1126 * Animometer/tests/master/resources/canvas-stage.js: Added.
1127 * Animometer/tests/master/resources/canvas-tests.js: Added.
1128 * Animometer/tests/master/resources/stage.css: Added.
1130 2015-12-23 Jon Lee <jonlee@apple.com>
1132 Split benchmark into two different pages
1133 https://bugs.webkit.org/show_bug.cgi?id=152458
1135 Reviewed by Simon Fraser.
1139 * Animometer/resources/debug-runner/benchmark-runner.js:
1140 (BenchmarkRunner.prototype._runTestAndRecordResults): When the testing is complete the frame owning the
1141 sampler goes away, and a later call to get the JSON data is no longer available. Process the data
1142 right here, instead, and just reference it when displaying the results in ResultsDashboard.prototype._processData.
1143 * Animometer/resources/extensions.js:
1144 (Array.prototype.fill.Array.prototype.fill): Add a null check. Remove braces around single-line clause.
1145 (Array.prototype.find.Array.prototype.find): Update the null check.
1146 (ResultsDashboard.prototype._processData): Use the already-processed data.
1147 * Animometer/resources/runner/animometer.css:
1148 (.frame-container > iframe): Remove calc().
1150 Move Array functions to extensions.js since that is included by the harness.
1151 Add ES6 Array polyfills.
1153 * Animometer/resources/algorithm.js:
1154 (Array.prototype.swap): Moved to extensions.js.
1155 * Animometer/resources/extensions.js:
1156 (Array.prototype.swap):
1157 (Array.prototype.fill): Added.
1158 (Array.prototype.find): Added.
1160 Adjust styles for iPad.
1162 * Animometer/resources/runner/animometer.css:
1163 (@media screen and (min-device-width: 768px)): Apply to iPad as well.
1164 (@media screen and (max-device-width: 1024px)): Update width for iPads.
1166 Adjustment styles for iOS.
1168 * Animometer/developer.html: Different divs contain the iframe, so use a class instead and
1169 update the style rules.
1170 * Animometer/index.html:
1171 * Animometer/resources/debug-runner/animometer.css: Remove extraneous rules.
1172 (@media screen and (min-device-width: 1800px)): Move this up.
1173 * Animometer/resources/runner/animometer.css: Add rules to accomodate iOS.
1175 Get rid of prefixed flex properties for now.
1177 * Animometer/resources/debug-runner/animometer.css:
1178 * Animometer/resources/runner/animometer.css:
1180 Update the structure of the harness. Remove the JSON-per-test but keep
1181 the JSON of the whole test run. Use the full page in order to display
1184 * Animometer/developer.html: Update several of the JS file includes to UTF-8. Remove header and footer. Test results screen includes score,
1185 average, and worst 5% statistics.
1186 * Animometer/index.html: Make structure similar to developer.html.
1187 * Animometer/resources/debug-runner/animometer.css: Remove most of the
1188 button rules since they are superfluous. Move the progress bar to the
1189 top, fixed. Update the results page rules.
1190 * Animometer/resources/debug-runner/animometer.js: Remove most of the
1191 additions to sectionsManager since they are no longer needed.
1192 (setSectionHeader): Updates header of the section.
1193 (window.suitesManager._updateStartButtonState): Update selector.
1194 (showResults): Add keypress event for selecting different data for
1195 copy/paste. Update how the results are populated. Include full test
1196 JSON in a textarea, rather than requiring a button press.
1198 * Animometer/resources/debug-runner/tests.js: Update structure of Headers. Define different kinds of headers. Headers can control their
1199 title, and the text used as the cell contents, including class name.
1200 * Animometer/resources/extensions.js:
1201 (ResultsTable): Update to include a flattened version of the headers,
1202 used while populating table contents. Remove unneeded helper functions
1203 for creating the table. Rename "show" to "add".
1204 * Animometer/resources/runner/animometer.css: Update rules to
1205 accommodate the new structure.
1206 * Animometer/resources/runner/animometer.js:
1207 (window.sectionsManager.setSectionScore): Helper function to set the
1208 score and mean for a section.
1209 (window.sectionsManager.populateTable): Helper function to set the table.
1210 (window.benchmarkController.showResults): Refactor.
1211 (window.benchmarkController.selectResults): Update selectors.
1212 * Animometer/resources/runner/tests.js: Set Headers. Debug harness
1215 Update debug runner to have similar names to the basic runner. Include
1216 that page's CSS and remove extraneous CSS rules.
1218 Get rid of the statistics table #record.
1220 * Animometer/developer.html: Rename #home to #intro. Rename .spacer to hr.
1221 * Animometer/resources/debug-runner/animometer.css: Set to flexbox when selected.
1222 * Animometer/resources/debug-runner/animometer.js: Remove recordTable.
1223 (window.suitesManager._updateStartButtonState): Update selector to #intro.
1224 (setupRunningSectionStyle): Deleted.
1226 * Animometer/resources/runner/animometer.css:
1227 (#test-container.selected): Change to flex-box only when visible.
1230 * Animometer/resources/debug-runner/benchmark-runner.js:
1231 (BenchmarkRunner.prototype._runTestAndRecordResults):
1232 * Animometer/resources/runner/tests.js:
1233 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js:
1234 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1235 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js:
1236 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js:
1237 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1238 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1239 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
1240 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
1241 * Animometer/tests/examples/resources/canvas-electrons.js:
1242 * Animometer/tests/examples/resources/canvas-stars.js:
1243 * Animometer/tests/misc/resources/compositing-transforms.js:
1244 * Animometer/tests/resources/main.js:
1245 * Animometer/tests/resources/stage.js:
1246 (StageBenchmark): Remove _recordTable.
1247 * Animometer/tests/simple/resources/simple-canvas-paths.js:
1248 * Animometer/tests/simple/resources/simple-canvas.js:
1249 * Animometer/tests/template/resources/template-canvas.js:
1250 * Animometer/tests/template/resources/template-css.js:
1251 * Animometer/tests/template/resources/template-svg.js:
1252 * Animometer/tests/text/resources/layering-text.js:
1254 * Animometer/resources/debug-runner/animometer.js:
1255 (willStartFirstIteration): Fix selector, since results-table is used
1256 in multiple places, so it cannot be an id.
1258 Make it possible to select the scores, or the whole table data,
1259 by cycling through different selections through key press of 's'.
1261 * Animometer/resources/runner/animometer.js:
1262 (window.benchmarkController.showResults): Attach a keypress handler
1263 if it hasn't been added already.
1264 (window.benchmarkController.selectResults):
1265 * Animometer/resources/runner/tests.js: Cycle through different
1268 Fix a few fly-by errors.
1270 * Animometer/resources/debug-runner/benchmark-runner.js:
1271 (BenchmarkRunnerState.prototype.prepareCurrentTest): Update the frame relative path
1272 since the files are now in the top directory instead of inside runner/.
1273 (BenchmarkRunner.prototype._runTestAndRecordResults): Incorrect reference to function.
1274 (BenchmarkRunner.prototype.step): Member variable is never used.
1276 A little stylistic cleanup.
1278 * Animometer/resources/debug-runner/benchmark-runner.js:
1279 * Animometer/resources/extensions.js:
1280 (window.DocumentExtension.createElement):
1281 * Animometer/tests/resources/main.js:
1282 (Benchmark.prototype.record):
1283 * Animometer/tests/resources/stage.js:
1284 (StageBenchmark.prototype.showResults): Reverse progress and message.
1285 The message appears less frequently than the progress.
1286 * Animometer/tests/simple/resources/simple-canvas.js:
1287 (SimpleCanvasBenchmark): Remove unused options.
1289 Add newer version of harness in a new page. Consolidate differences between the two
1292 * Animometer/developer.html: Include runner/animometer.js. Rename the JS function
1293 to run the benchmark to startBenchmark() instead of startTest(). Rename #running to
1295 * Animometer/index.html: Added. Similarly calls startBenchmark() and has #test-container.
1296 * Animometer/resources/debug-runner/animometer.css: Make the canvas 2:1 (1200px x 800px)
1299 Split out benchmarkRunnerClient and benchmarkController.
1301 * Animometer/resources/debug-runner/animometer.js: Move needed functions out of
1302 benchmarkRunnerClient, and leave the rest here to extend that object. Get rid of _resultsTable
1303 and move populating the results table into benchmarkController. Rename _resultsDashboard
1304 to results and make it accessible for other objects to use.
1305 (willAddTestFrame): This is unnecessary. Remove.
1307 (window.sectionsManager.showScore): Grab it from the results object instead of
1308 benchmarkRunnerClient.
1309 (window.sectionsManager.showSection): Deleted. Moved to runner/animometer.js.
1311 (window.benchmarkController._runBenchmark): Deleted. Mostly moved into _startBenchmark.
1312 (window.benchmarkController.startBenchmark): Refactor to call _startBenchmark.
1313 (window.benchmarkController.showResults): Include most of benchmarkRunnerClient.didFinishLastIteration()
1316 * Animometer/resources/debug-runner/benchmark-runner.js:
1317 (BenchmarkRunner.prototype._appendFrame): Remove unneeded call to willAddTestFrame.
1318 * Animometer/resources/extensions.js:
1319 (ResultsDashboard): Change the class to process the sampler data on-demand and hold onto that data
1320 for later referencing.
1321 (ResultsDashboard.prototype.toJSON): Deleted.
1322 (ResultsDashboard.prototype._processData): Rename toJSON to _processData since it's not really
1323 outputting JSON. Store the processed data into a member variable that can be referenced later.
1324 (ResultsDashboard.prototype.get data): Process the data if it hasn't already.
1325 (ResultsDashboard.prototype.get score): Process the data if it hasn't already, then return the
1327 (ResultsTable.prototype._showHeader): When outputting the results to a table, don't force the
1328 need for an empty children array. This was to allow for a header row in the table that spanned
1329 multiple columns. In the simpler harness, this is not needed.
1330 (ResultsTable.prototype._showEmptyCells):
1331 (ResultsTable.prototype._showTest): This hardcoded the columns. At least for the name and score,
1332 which is the bare minimum needed for the simpler harness, key off of the header name provided.
1333 * Animometer/resources/runner/animometer.css: Added. Use a similar 2:1 ratio. The score tables are
1334 split into the data and the headers, and are also displayed RTL so that a later patch allows a
1335 user to copy-paste the data easily.
1336 * Animometer/resources/runner/animometer.js: Added. Use a simpler version of benchmarkRunnerClient.
1337 The debug harness will extend these classes.
1338 (window.benchmarkController._startBenchmark): Used by both harnesses.
1339 (window.benchmarkController.startBenchmark): Set hard-coded options.
1340 (window.benchmarkController.showResults): Includes most of benchmarkRunnerClient.didFinishLastIteration()
1343 Get rid of utilities.js. Move it all into extensions.js.
1345 * Animometer/resources/extensions.js:
1346 * Animometer/tests/resources/utilities.js: Removed.
1348 * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Remove script link.
1349 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Ditto.
1350 * Animometer/tests/bouncing-particles/bouncing-css-images.html: Ditto.
1351 * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Ditto.
1352 * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Ditto.
1353 * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Ditto.
1354 * Animometer/tests/examples/canvas-electrons.html: Ditto.
1355 * Animometer/tests/examples/canvas-stars.html: Ditto.
1356 * Animometer/tests/misc/compositing-transforms.html: Ditto.
1357 * Animometer/tests/simple/simple-canvas-paths.html: Ditto.
1358 * Animometer/tests/template/template-canvas.html: Ditto.
1359 * Animometer/tests/template/template-css.html: Ditto.
1360 * Animometer/tests/template/template-svg.html: Ditto.
1361 * Animometer/tests/text/layering-text.html: Ditto.
1363 Split tests.js into two. Add a new suite to runner/tests.js.
1365 * Animometer/developer.html: Update the script order. Scripts from
1366 debug-runner/ will always build on those from runner/, and have the
1368 * Animometer/resources/debug-runner/tests.js: Move "complex examples"
1369 suite into "miscellaneous tests".
1371 (Suite.prototype.prepare): Deleted.
1372 (Suite.prototype.run): Deleted.
1373 (suiteFromName): Deleted.
1374 * Animometer/resources/runner/tests.js: Added. Take definitions and
1375 functions needed by the test harness. Leave the test suites behind.
1376 (Suite): Moved from debug script.
1377 (Suite.prototype.prepare): Ditto.
1378 (Suite.prototype.run): Ditto.
1379 (suiteFromName): Ditto.
1380 (testFromName): Ditto.
1382 Move benchmark resources out into resources/debug-runner, and update URLs.
1384 * Animometer/developer.html: Renamed from PerformanceTests/Animometer/runner/animometer.html.
1385 * Animometer/resources/debug-runner/animometer.css: Renamed from PerformanceTests/Animometer/runner/resources/animometer.css.
1386 * Animometer/resources/debug-runner/animometer.js: Renamed from PerformanceTests/Animometer/runner/resources/animometer.js.
1387 * Animometer/resources/debug-runner/benchmark-runner.js: Renamed from PerformanceTests/Animometer/runner/resources/benchmark-runner.js.
1388 * Animometer/resources/debug-runner/d3.min.js: Renamed from PerformanceTests/Animometer/runner/resources/d3.min.js.
1389 * Animometer/resources/debug-runner/graph.js: Renamed from PerformanceTests/Animometer/runner/resources/graph.js.
1390 * Animometer/resources/debug-runner/tests.js: Renamed from PerformanceTests/Animometer/runner/resources/tests.js.
1392 2015-12-11 Jon Lee <jonlee@apple.com>
1394 Improve Animometer on iOS
1395 https://bugs.webkit.org/show_bug.cgi?id=152180
1397 Reviewed by Simon Fraser.
1399 Improve experience on phones. Make the canvas take
1400 up the whole screen.
1402 * Animometer/runner/animometer.html: Add meta viewport.
1403 Remove the container div.
1404 * Animometer/runner/resources/animometer.css: Have buttons lay
1405 out vertically. Update detail arrow glyph. Make the suites and
1406 options section lay out vertically. Remove the top spacers since
1407 we want the canvas to take over the whole screen. Minimal display
1408 is recommended for use.
1410 2015-12-07 Jon Lee <jonlee@apple.com>
1412 Update suites for benchmark
1413 https://bugs.webkit.org/show_bug.cgi?id=151957
1415 Reviewed by Simon Fraser.
1417 * Animometer/runner/animometer.html: Use spacers instead of relying on
1418 justify-content center to center the content. That allows the opening screen
1419 to grow downward when expanding the list of choices, otherwise it expands
1420 from the center, and off the top edge of the screen.
1421 * Animometer/runner/resources/animometer.css:
1422 (.tree): Don't overflow scroll.
1423 (.tree > li > label.tree-label:before): Use better glyphs.
1424 (.tree > li > :checked ~ label.tree-label:before):
1425 (main): Using flex-start for justify-content so that if the section grows too
1426 big it gets pinned to the top edge of the document instead of growing past it.
1427 (.spacer): Make the spacers have a minimum 20px and grow evenly.
1428 (section#home): Add a min-height so that the border will expand if the suite
1429 tests shown make the section grow past the height.
1430 * Animometer/runner/resources/animometer.js: Update the selectors.
1431 (window.suitesManager._treeElement):
1432 (window.suitesManager._suitesElements):
1433 (window.suitesManager._editsElements):
1435 2015-12-07 Jon Lee <jonlee@apple.com>
1437 Update options for benchmark
1438 https://bugs.webkit.org/show_bug.cgi?id=151956
1440 Reviewed by Simon Fraser.
1442 Move "Fix test complexity" and "Adaptive" checkboxes into a radio group.
1444 Move "Show running results" into a radio group, and add options to remove the HUD.
1446 * Animometer/runner/animometer.html: Get rid of the preamble. Wrap the options
1447 in a form for easier referencing in JS.
1448 * Animometer/runner/resources/animometer.css: Show the surrounding border if the
1449 body's display-minimal class name is set.
1450 * Animometer/runner/resources/animometer.js:
1452 Update the way optionsManager gets and sets default values. Include support for
1454 (window.optionsManager.valueForOption):
1455 (window.optionsManager.updateUIFromLocalStorage):
1456 (window.optionsManager.updateLocalStorageFromUI):
1458 (window.benchmarkRunnerClient.willStartFirstIteration):
1459 (window.sectionsManager.setupRunningSectionStyle):
1460 (window.suitesManager._treeElement): Fly-by whitespace fix.
1461 (window.suitesManager._suitesElements): Ditto.
1462 (window.suitesManager.updateEditsElementsState): Update options check.
1463 (window.suitesManager.updateDisplay): Add a new update function for the HUD.
1464 Attach a class to the body depending on the user's choice.
1465 (window.benchmarkController.initialize): Add an event listener when the form
1466 radio buttons update.
1467 (window.benchmarkController.onFormChanged):
1468 (window.optionsManager._optionsElements): Deleted.
1469 (window.optionsManager._adaptiveTestElement): Deleted.
1470 (window.benchmarkController.onChangeAdaptiveTestCheckbox): Deleted.
1471 * Animometer/tests/resources/main.js:
1472 (Benchmark.prototype.update): Update options checks.
1473 * Animometer/tests/resources/stage.js: Update option check.
1474 (StageBenchmark.prototype.showResults):
1476 2015-12-01 Simon Fraser <simon.fraser@apple.com>
1478 Add a basic compositing Animometer test
1479 https://bugs.webkit.org/show_bug.cgi?id=151724
1481 Reviewed by Dean Jackson.
1483 Add a "bouncing particles" test that moves composited layers around, optionally with a filter.
1485 This is added under a new "Miscellaneous" category.
1487 Remove the test templates category from the UI.
1489 * Animometer/runner/resources/tests.js:
1490 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js:
1491 (BouncingCssShape.prototype.animate):
1492 * Animometer/tests/misc/compositing-transforms.html: Added.
1493 * Animometer/tests/misc/resources/compositing-transforms.js: Added.
1494 (BouncingCompositedImage):
1495 (BouncingCompositedImage.prototype._move):
1496 (BouncingCompositedImage.prototype.animate):
1497 (CompositingTransformsStage):
1498 (CompositingTransformsStage.prototype.createParticle):
1499 (CompositingTransformsStage.prototype.particleWillBeRemoved):
1500 (CompositedTransformsBenchmark):
1501 (CompositedTransformsBenchmark.prototype.createStage):
1502 (window.benchmarkClient.create):
1504 2015-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
1506 Fix the graphics benchmark complexity bounds adjustment
1507 https://bugs.webkit.org/show_bug.cgi?id=151670
1509 Reviewed by Simon Fraser.
1511 Make sure the graphics benchmark complexity bounds adjustment is applied
1512 to the absolute lower bound.
1514 * Animometer/tests/resources/math.js:
1515 (PIDController.prototype._saturate):
1517 2015-11-30 Said Abou-Hallawa <sabouhallawa@apple.com>
1519 Add an option to select the results form the graphics benchmark
1520 https://bugs.webkit.org/show_bug.cgi?id=151666
1522 Reviewed by Ryosuke Niwa.
1524 We need an easy way to select the graphics benchmark results table such
1525 that when it is copied to the clipboard, rich text format is set to the
1528 * Animometer/runner/animometer.html: Add a new button to select the results table or JSON.
1530 * Animometer/runner/resources/animometer.js:
1531 (window.sectionsManager._sectionDataElement): Selects the container <data> element.
1532 (window.sectionsManager._sectionDataDivElement): Replace a literal string with a string table entry.
1533 (window.sectionsManager.showTestName): Replace a literal string with a string table entry.
1534 (window.sectionsManager.selectData): Selects the container <data> element in a selection.
1535 (window.sectionsManager.selectDataContents): Select the contents of container <data> element in a selection.
1536 (window.benchmarkController.selectResults): Selects the results table.
1537 (window.benchmarkController.showJSON): Function rename.
1538 (window.benchmarkController.selectJSON): Selects the contents of the results JSON.
1539 (window.benchmarkController.showJson): Deleted.
1541 2015-11-20 Simon Fraser <simon.fraser@apple.com>
1543 Animometer: graphs should not do interpolation
1544 https://bugs.webkit.org/show_bug.cgi?id=151526
1546 Reviewed by Simon Fraser.
1548 Having the graphs do interpolation is misleading, because you can't see the actual data.
1550 Also remove "shape-rendering: crispEdges;" so the lines get antialiased.
1552 * Animometer/runner/resources/animometer.css:
1553 (section#test-graph > data > svg): Deleted.
1554 * Animometer/runner/resources/graph.js:
1557 2015-11-19 Said Abou-Hallawa <sabouhallawa@apple.com>
1559 Calculate the graphics benchmark test gain adaptively
1560 https://bugs.webkit.org/show_bug.cgi?id=151208
1562 Reviewed by Darin Adler.
1564 We need to calculate the gain of the graphics benchmark tests adaptively
1565 and get rid of the gain and limits parameters we have to choose manually
1566 for every test. We are going to use the classic Ziegler–Nichols method for
1567 calculating the gain and integral and derivative times. We are going to
1568 try moving on a cubic curve during the manual stage from y0 to reach ysp.
1569 We also going to use a saturation actuator to ensure the system does not
1572 * Animometer/resources/extensions.js:
1573 (ResultsTable.prototype._isNoisyMeasurement): Fix a parameter name.
1574 (ResultsTable.prototype._isNoisyTest): Since score is a member of testResults, we need to limit our search to frame rate and complexity.
1575 (ResultsTable.prototype._showTest): Pass the correct parameter to _isNoisyMeasurement().
1577 * Animometer/resources/strings.js: Fix the indentation and name and value of a string.
1579 * Animometer/runner/resources/tests.js: Remove all the manual gains and limits parameters which had to be passed to every test.
1581 * Animometer/tests/resources/main.js:
1582 (BenchmarkState.prototype.currentStage): Fix an enum name.
1583 (Benchmark): Get rid of manual gain and limits.
1584 (Benchmark.prototype.update): Simplify the calculation by having all the times in ms.
1586 * Animometer/tests/resources/math.js:
1587 (PIDController): Get rid of the manual gain and limits and the magic numbers for Ti and Td.
1588 (PIDController.prototype._yPosition): Tells whether the test current output is moving towards the set-point or away from it.
1589 (PIDController.prototype._distanceUltimate): Calculates the ultimate distance from y0 after time t using a cubic formula.
1590 (PIDController.prototype._distance): Calculates the distance of y relative to y0.
1591 (PIDController.prototype._gainIncrement): Decides how much the proportional gain should be increased during the manual gain stage.
1592 (PIDController.prototype._updateStage): Updates the stage of the controller based on its current stage and the system output.
1593 (PIDController.prototype._tuneP): Tunes the system before calculating the PID controller gains.
1594 (PIDController.prototype._tunePID): PID tuning function.
1595 (PIDController.prototype._tune):
1596 (PIDController.prototype._saturate):
1597 (PIDController.prototype.tune): Manages calculating the controller parameters. It then returns a PID tuning value.
1598 (PIDController.prototype._sat): Deleted. We may need to return it back but the limits have to be calculated adaptively not manually.
1600 2015-11-17 Said Abou-Hallawa <sabouhallawa@apple.com>
1602 Reorganize the graphics benchmark string table
1603 https://bugs.webkit.org/show_bug.cgi?id=151334
1605 Reviewed by Simon Fraser.
1607 Make the graphics benchmark string table be an object of sub-objects. Each
1608 sub-object represents an associative array, the key is the string name and
1609 the value is the string data.
1611 * Animometer/resources/extensions.js:
1612 (ResultsDashboard.prototype.toJSON):
1613 (ResultsTable.prototype._showGraph):
1614 (ResultsTable.prototype._showJSON):
1615 (ResultsTable.prototype._isNoisyMeasurement):
1616 (ResultsTable.prototype._isNoisyTest):
1617 (ResultsTable.prototype._showTest):
1618 (ResultsTable.prototype._showSuite):
1619 (ResultsTable.prototype._showIteration):
1620 * Animometer/resources/sampler.js:
1621 (Sampler.prototype.toJSON):
1622 * Animometer/resources/strings.js:
1623 * Animometer/runner/resources/animometer.js:
1624 (window.benchmarkRunnerClient.didFinishLastIteration):
1625 (window.suitesManager.updateLocalStorageFromJSON):
1626 (window.benchmarkController.showResults):
1627 (window.benchmarkController.showJson):
1628 (window.benchmarkController.showTestGraph):
1629 (window.benchmarkController.showTestJSON):
1630 * Animometer/runner/resources/tests.js:
1631 * Animometer/tests/resources/main.js:
1633 2015-11-17 Said Abou-Hallawa <sabouhallawa@apple.com>
1635 Disable flattening the stage iframe of the graphics benchmark when running on iOS
1636 https://bugs.webkit.org/show_bug.cgi?id=151361
1638 Reviewed by Simon Fraser.
1640 Use fixed size for stage iframe of the graphics benchmark to disable
1641 flattening the iframe while animating the particles. Also ensure the
1642 bouncing particles do not go outside the iframe's boundaries.
1644 * Animometer/runner/resources/animometer.css:
1645 (section#running > #running-test > iframe):
1646 (@media screen and (min-device-width: 1800px)):
1647 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1648 (BouncingParticle.prototype.animate):
1650 2015-11-17 Said Abou-Hallawa <sabouhallawa@apple.com>
1652 Use the media queries to dynamically set the stage for the graphics benchmark
1653 https://bugs.webkit.org/show_bug.cgi?id=151327
1655 Reviewed by Simon Fraser.
1657 Clean setting the benchmark css rules by using the media queries. Accessing
1658 document.stylesheets.cssRules seems to be unreliable. Fix the test harness
1659 load event listener invocation. And also remove the options for normalizing
1660 the stage resolution for retina display.
1662 * Animometer/resources/extensions.js:
1663 (window.DocumentExtension.insertCssRuleAfter): Deleted.
1664 * Animometer/runner/animometer.html:
1665 * Animometer/runner/resources/animometer.css:
1666 (@media screen and (min-device-width: 1800px)):
1667 * Animometer/runner/resources/animometer.js:
1668 (window.sectionsManager.setupRunningSectionStyle):
1669 (window.benchmarkController.initialize):
1670 (window.sectionsManager.setupSectionStyle): Deleted.
1671 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1672 (BouncingParticlesStage):
1673 * Animometer/tests/text/layering-text.html:
1674 * Animometer/tests/text/resources/layering-text.js:
1675 (LayeringTextStage):
1676 (LayeringTextStage.prototype._setFontSize): Deleted.
1678 2015-11-16 Said Abou-Hallawa <sabouhallawa@apple.com>
1680 Remove the option for animating using setInterval from the graphics benchmark
1681 https://bugs.webkit.org/show_bug.cgi?id=151283
1683 Reviewed by Darin Adler.
1685 Get rid of the option to run animation using setInterval().
1687 * Animometer/tests/resources/main.js:
1688 (Animator.prototype.animate):
1690 (Benchmark.prototype.start):
1691 (Animator.prototype.start): Deleted.
1693 2015-11-16 Said Abou-Hallawa <sabouhallawa@apple.com>
1695 Highlight the alarming test results in the graphics benchmark results page
1696 https://bugs.webkit.org/show_bug.cgi?id=151286
1698 Reviewed by Simon Fraser.
1700 When showing the results of a test in the graphics benchmark the following
1701 criteria is going to be applied:
1703 1. If the standard deviation of the test complexity or the frame rate is
1704 equal to or more than 10%, the standard deviation and the test name
1705 will be displayed in red.
1706 2. If the average frame rate is not in the range = [(desired_frame_rate - 2)
1707 .. (desired_frame_rate + 2)], the average frame rate and the test name will
1708 be displayed in red.
1710 * Animometer/resources/extensions.js:
1711 (ResultsTable.prototype._showHeaderRow):
1712 (ResultsTable.prototype._showHeader):
1713 (ResultsTable.prototype._showEmptyCell):
1714 (ResultsTable.prototype._showText):
1715 (ResultsTable.prototype._showFixedNumber):
1716 (ResultsTable.prototype.):
1717 (ResultsTable.prototype._showGraph):
1718 (ResultsTable.prototype._showJSON):
1719 (ResultsTable.prototype._isAlarmingMeasurement):
1720 (ResultsTable.prototype._isAlarmingTestResults):
1721 (ResultsTable.prototype._showEmptyCells):
1722 (ResultsTable.prototype._showEmptyRow):
1723 (ResultsTable.prototype._showTest):
1724 (ResultsTable.prototype._showSuite):
1725 (ResultsTable.prototype._showIteration):
1726 (ResultsTable.prototype.showRecord):
1727 (ResultsTable.prototype.showIterations):
1728 (ResultsTable.prototype._showEmpty): Deleted.
1729 * Animometer/runner/resources/animometer.js:
1730 (window.benchmarkRunnerClient.didFinishLastIteration):
1731 * Animometer/tests/resources/stage.js:
1732 (StageBenchmark.prototype.showResults):
1734 2015-11-16 Said Abou-Hallawa <sabouhallawa@apple.com>
1736 Clean referencing the options object in the graphics benchmark
1737 https://bugs.webkit.org/show_bug.cgi?id=151284
1739 Reviewed by Simon Fraser.
1741 Get rid of the Benchmark.options member and rely only on the private member
1742 Benchmark._options. The animator need to have its own options member instead
1743 of accessing it from its reference to Benchmark object.
1745 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js:
1746 (BouncingCanvasParticlesAnimator):
1747 (BouncingCanvasParticlesBenchmark.prototype.createAnimator):
1748 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
1749 (BouncingParticle.prototype.animate):
1750 (BouncingParticlesAnimator):
1751 (BouncingParticlesBenchmark.prototype.createAnimator):
1752 * Animometer/tests/examples/resources/canvas-electrons.js:
1753 (CanvasElectronsStage.prototype.animate):
1754 (CanvasElectronsAnimator):
1755 (CanvasElectronsBenchmark.prototype.createAnimator):
1756 (window.benchmarkClient.create):
1757 * Animometer/tests/examples/resources/canvas-stars.js:
1758 (CanvasStarsStage.prototype.animate):
1759 (CanvasStarsAnimator):
1760 (CanvasStarsBenchmark.prototype.createAnimator):
1761 (window.benchmarkClient.create):
1762 * Animometer/tests/resources/main.js:
1763 (BenchmarkState.prototype.currentProgress):
1765 (Animator.prototype.animate):
1767 (Benchmark.prototype.update):
1768 * Animometer/tests/resources/stage.js:
1769 (Stage.prototype.clear):
1771 (StageBenchmark.prototype.createAnimator):
1772 (StageBenchmark.prototype.tune):
1773 (StageBenchmark.prototype.showResults):
1774 * Animometer/tests/simple/resources/simple-canvas.js:
1775 (SimpleCanvasStage.prototype.animate):
1776 (SimpleCanvasAnimator):
1777 (SimpleCanvasAnimator.prototype.animate):
1778 (SimpleCanvasBenchmark.prototype.createAnimator):
1779 * Animometer/tests/template/resources/template-canvas.js:
1780 (TemplateCanvasStage.prototype.animate):
1781 (TemplateCanvasBenchmark.prototype.createAnimator):
1782 (window.benchmarkClient.create):
1784 2015-11-13 Said Abou-Hallawa <sabouhallawa@apple.com>
1786 Eliminate a request for layout every time an item is added to the stage of the graphics benchmark
1787 https://bugs.webkit.org/show_bug.cgi?id=151289
1789 Reviewed by Simon Fraser.
1791 Cache the stage size when it is created instead of requesting every time
1792 an object is added via clientWidth and clientHeight.
1794 * Animometer/resources/extensions.js:
1795 (Insets.elementPadding):
1796 * Animometer/tests/resources/stage.js:
1798 (Stage.prototype.get size):
1800 2015-11-06 Said Abou-Hallawa <sabouhallawa@apple.com>
1802 Initialize the graphics benchmark's Kalman filter with estimated 60 FPS
1803 https://bugs.webkit.org/show_bug.cgi?id=150965
1805 Reviewed by Darin Adler.
1807 This should give the benchmark more accurate reading at warmup time. And
1808 hence we can safely reduce the test running time to be 10 seconds.
1810 * Animometer/runner/animometer.html:
1811 Add "defer" back when loading resources/animometer.js since this script
1812 depends on many other scripts and we need to wait till the page is parsed.
1813 Also change the default test interval to be 10 seconds.
1815 * Animometer/runner/resources/graph.js:
1816 (graph): Make the test results curves smoother.
1818 * Animometer/tests/resources/main.js:
1819 (Animator): Initialize the Kalman filter with 60 FPS which should be true
1820 if the test page is empty.
1822 (Animator.prototype.animate):
1823 * Animometer/tests/resources/math.js:
1824 (KalmanEstimator): Fix the initial value of _vecX_est.
1825 _vecX_est[0] = current FPS (= 60FPS when the test page is empty)
1826 _vecX_est[1] = first time derivative of FPS (=0; FPS has been constant).
1827 _vecX_est[2] = second time derivative of FPS (=0; since _vecX_est[1]=0).
1828 (KalmanEstimator.prototype.estimate): Add some comments.
1830 2015-11-04 Said Abou-Hallawa <sabouhallawa@apple.com>
1832 Remove "defer" from the scripts' references in the graphics benchmark home page
1833 https://bugs.webkit.org/show_bug.cgi?id=150915
1835 Reviewed by Simon Fraser.
1837 It causes the benchmark to be very flakey.
1839 * Animometer/runner/animometer.html:
1841 2015-11-01 Said Abou-Hallawa <sabouhallawa@apple,com>
1843 Add an option to make the graphics benchmark runs a specific test with fixed complexity
1844 https://bugs.webkit.org/show_bug.cgi?id=150529
1846 Reviewed by Darin Adler.
1848 Beside each test in the suites tree, we are going to show the complexity
1849 arithmetic mean of the of the last run in an edit control. Based on a
1850 new option these edit controls will all be visible or hidden. If they are
1851 visible their values can be changed. The benchmark runner if it run in
1852 the non-adaptive mode will set the complexity of the test to the passed
1853 value and will not change it ever. The animator will animate the test and
1854 frame rate will also be measured.
1856 * Animometer/runner/animometer.html: Add a new option for the non-adaptive mode.
1858 * Animometer/runner/resources/animometer.css:
1859 (section#home input[type="number"]): Define the width of all the edit control in the <home> section.
1860 (section#home > suites input[type="number"]): The edit controls in the <suites> box will be right aligned and hidden by default.
1861 (section#home > suites input[type="number"].selected): When the class "selected" is added, the edit controls will be visible.
1862 (section#home > options > label > input[type="number"]): Deleted.
1864 * Animometer/runner/resources/animometer.js:
1865 (window.benchmarkRunnerClient.didFinishLastIteration): Update the local storage with the results of each test.
1866 (window.optionsManager._adaptiveTestElement): Returns the checkbox for setting the adaptive test option.
1867 (window.suitesManager._editElement): Returns the edit element associated with each test element in the suites tree.
1868 (window.suitesManager._editsElements): Returns a list of all the elements in the <suites> box.
1869 (window.suitesManager._localStorageNameForTest): Change this function to take strings.
1870 (window.suitesManager._createTestElement): Adds an edit control beside each test.
1871 (window.suitesManager.updateEditsElementsState): Adds/Removes the 'selected' class to/from all the tests edit elements.
1872 (window.suitesManager.updateUIFromLocalStorage): Reads the edit control value from the local storage.
1873 (window.suitesManager.updateLocalStorageFromUI): Saves the edit control value to the local storage.
1874 (window.suitesManager.updateLocalStorageFromJSON): Saves the last run results to the local storage.
1875 (window.benchmarkController.initialize): Shows/Hides the test edit controls based on the adaptive test option.
1876 (window.benchmarkController.onChangeAdaptiveTestCheckbox): An onchange event handler for the adaptive test checkbox.
1878 * Animometer/tests/resources/main.js:
1879 (Benchmark.prototype.update): Fix the complexity of the test if the running mode is non-adaptive test and desired complexity is not zero.
1880 (window.runBenchmark): Add the test complexity as a new benchmark option.
1882 2015-11-01 Said Abou-Hallawa <sabouhallawa@apple,com>
1884 Make the size of the benchmark canvas adaptive to the screen size and screen resolution
1885 https://bugs.webkit.org/show_bug.cgi?id=150530
1887 Reviewed by Darin Adler.
1889 We want to set the size of the benchmark stage dynamically such that it
1890 depends on the screen resolution and the device scale factor. This patch
1891 does more than that because the home page css was not done properly. To
1892 use the flex box layout, the animometer.css has to be rewritten almost from
1893 scratch. The suites tree has to be rewritten also because it was not collapsing
1894 and with the flex box layout it was going outside of the window area. The
1895 options handling and the local storage handling had to be rewritten to
1896 allow more flexibility with this patch and the future patches. The code
1897 in animometer.js was reorganized into objects to allow distributing the code
1898 nicely among separate entities.
1900 * Animometer/resources/extensions.js:
1901 (Point.elementClientSize): Returns the client size of an HTMLElement as a Point object.
1902 (Insets.prototype.get width): Follow the function opening brace style guidelines.
1903 (Insets.prototype.get height):
1904 (Insets.prototype.get size): Returns the size of an Insets as a Point object.
1906 (window.DocumentExtension): Provides document helper functions. It should be assailable from the runner and the tests.
1907 (window.DocumentExtension.createElement): Creates an HTMLElement given its name, attributes and parentElement.
1908 (window.DocumentExtension.createSvgElement): Creates an SVGElement given its name, attributes and parentElement (moved from utilities.js).
1909 (window.DocumentExtension.insertCssRuleAfter): Inserts a CSS rule after an exiting rule given its text.
1911 (ResultsTable.prototype._showHeader): Use DocumentExtension functions.
1912 (ResultsTable.prototype._showGraph): Use DocumentExtension functions and create a real button for "Graph..." option.
1913 (ResultsTable.prototype._showJSON): Use DocumentExtension functions and create a real button for "JSON..." option.
1916 * Animometer/runner/animometer.html: Restructure the page to use the flex box layout.
1918 * Animometer/runner/resources/animometer.css:
1922 (button.large-button):The large button appears in the animometer.html.
1923 (button.large-button:active):
1924 (button.large-button:disabled):
1926 (button.small-button): The small button appears in the results table.
1927 (button.small-button:active):
1929 (.tree): The tree class is used to list the suites and their tests.
1930 (.tree .expand-button): This button expands a tree element.
1931 (.tree .expand-button ~ ul): Hide the children (<ul>...</ul>) of a parent node by default.
1932 (.tree .expand-button:checked ~ ul): Show the children of a parent node only when checked.
1933 (.tree ul): Hide the list bullets.
1934 (.tree li): Indent every node in the tree relative to its parent.
1935 (.tree ul li): Indent all the non top level nodes only (the tests nodes in our case).
1936 (.tree > li:last-child): Do not indent the bottom of the last child node.
1937 (.tree-label): Style for all the labels in the tree.
1938 (label.tree-label): Style for the labels in the top level only (the suites nodes in our case).
1939 (label.tree-label:before): Style the unchecked case of the expand-button.
1940 (:checked ~ label.tree-label:before): Style the checked case of the expand-button.
1942 (table.results-table): The results table appears while running the test and at the end.
1943 (.results-table td):
1944 (.results-table th):
1946 (div.results-json): The JSON div appears per test or for the whole run.
1948 (main): This is the flex box container.
1950 (section): A section is displayed exclusively inside the <main>. It is hidden by default.
1951 (section.selected): When it is selected, its layout is flex layout.
1952 (section > footer): The header or the footer of a section should not take more than 15% of the container.
1954 (section#home): The home section has <suites> and <options> parts to be laid out in the middle.
1955 (section#home > options):
1956 (section#home > suites): The <suites> should not take more than 40% of the width.
1957 (section#home > options > label): The benchmark title.
1958 (section#home > header > h2): The benchmark title.
1959 (section#home > options > label > input[type="number"]): Sets the width of the option edit control.
1961 (section#running): The running section contain the runner <iframe> which takes the whole area of the <main>.
1962 (section#running > #running-test): This is the <iframe> container.
1963 (section#running > #running-test > iframe): The <iframe> is created by the runner for each test.
1964 (section#running > #progress): This is the progress bar.
1965 (section#running > #progress > #progress-completed): This is another element which grows while the runner is progressing.
1966 (section#running > #record): This the container of the record results table which is shown while running a test.
1970 (section#test-json):
1971 (section#test-graph): All these sections have the same layout. A <data> element is laid out between <header> and <footer>.
1973 (section#results > data):
1974 (section#json > data):
1975 (section#test-json > data):
1976 (section#test-graph > data): The <data> element should take 70% of the <section>.
1978 (section#test-graph > data > svg):
1980 (.left-samples): These styles are for the d3 graph.
1982 (section#test-json > data): This is the style of the JSON <data> element.
1985 (label, p): Deleted.
1986 (section > p): Deleted.
1987 (section#home > p): Deleted.
1988 (section#home > p:first-child): Deleted.
1989 (#testContainer): Deleted.
1990 (section#running #progress-completed): Deleted.
1991 (section#results > table): Deleted.
1992 (section#results > table td, th): Deleted.
1993 (section#results > table tr.alt, td): Deleted.
1994 (section#results > table th): Deleted.
1995 (section#json > textarea): Deleted.
1996 (.options): Deleted.
1997 (.options p): Deleted.
1998 (#suites ul): Deleted.
1999 (#suites ul ul): Deleted.
2000 (#suites ul ul input, #suites ul ul label): Deleted.
2001 (#suites.showTests ul ul): Deleted.
2003 (input[type="number"]): Deleted.
2004 (.buttons): Deleted.
2005 (.small-button): Deleted.
2006 (#graphContainer): Deleted.
2007 (.right-samples): Deleted.
2008 (.sample-time): Deleted.
2009 (.left-mean): Deleted.
2010 (.right-mean): Deleted.
2012 * Animometer/runner/resources/animometer.js:
2013 (window.benchmarkRunnerClient.initialize): Initialize the client object with the options and the suites.
2014 (window.benchmarkRunnerClient.willStartFirstIteration): Use new css selectors for results and the record table.
2015 (window.benchmarkRunnerClient.didFinishLastIteration): Move the code which sets the JSON text to sectionsManager.showJSON().
2017 (window.sectionsManager): Responsible of managing the <section>s elements inside animometer.html.
2018 (window.sectionsManager._sectionHeaderH1Element): Return the <h1> inside the <header> of a given section.
2019 (window.sectionsManager._sectionDataDivElement): Return the <div> inside the <data> of a given section.
2020 (window.sectionsManager.showScore): Show the score of the last benchmark run.
2021 (window.sectionsManager.showTestName): Show the test name for detailed results <section>.
2022 (window.sectionsManager.showJSON): Shows the JSON text of the last benchmark or for a specific test.
2023 (window.sectionsManager.showSection): Shows a specific <section> in the <main> container.
2024 (window.sectionsManager.setupSectionStyle): Sets css attributes for all the <section>s.
2025 (window.sectionsManager.setupRunningSectionStyle): Sets the css attributes for the running <section> only.
2027 (window.optionsManager): Responsible of managing the user options and streaming them to/form the localStorage.
2028 (window.optionsManager._optionsElements): Returns the children <input> elements of the <options>.
2029 (window.optionsManager.updateUIFromLocalStorage): Restore the values of the <options> UI elements from the local storage.
2030 (window.optionsManager.updateLocalStorageFromUI): Saves the values of the <options> UI elements to the local storage.
2032 (window.suitesManager): Responsible of managing the user suites and streaming them to/form the localStorage.
2033 (window.suitesManager._treeElement): Returns the suites tree container element.
2034 (window.suitesManager._suitesElements): Returns a list of the suites elements.
2035 (window.suitesManager._checkboxElement): Returns the checkbox element of a given suite.
2036 (window.suitesManager._localStorageNameForTest): Generates a string for the tuple <suite, test> to be saved in the localStorage.
2037 (window.suitesManager._updateSuiteCheckboxState): Updates the state of a suite checkbox from the state of its tests' checkboxes.
2038 (window.suitesManager._updateStartButtonState): Updates the state of the start button from the state of the suites' checkboxes.
2039 (window.suitesManager._onChangeSuiteCheckbox): Called when a suite checkbox is clicked.
2040 (window.suitesManager._onChangeTestCheckbox): Called when a test checkbox is clicked.
2041 (window.suitesManager._createSuiteElement): Creates suite node in the suites tree.
2042 (window.suitesManager._createTestElement): Creates test node in the suites tree.
2043 (window.suitesManager.createElements): Creates the suites tree dynamically from the array Suites.
2044 (window.suitesManager.updateUIFromLocalStorage): Restore the values of the <suites> UI elements from the local storage.
2045 (window.suitesManager.updateLocalStorageFromUI): aves the values of the <suites> UI elements to the local storage.
2047 (window.benchmarkController): This is the UI controller of the animometer.html page.
2048 (window.benchmarkController.initialize): Called when the animometer.html page is loaded.
2049 (window.benchmarkController._runBenchmark): Starts a benchmark run.
2050 (window.benchmarkController.startTest): Called when the "Start Test" button is clicked.
2051 (window.benchmarkController.showResults): Called at the end of the test to show the final results.
2052 (window.benchmarkController.showJson): Called from the results page to show the JSON of the last benchmark run.
2053 (window.benchmarkController.showTestGraph): Called from the results the table to show a graph for the samples of a specific test.
2054 (window.benchmarkController.showTestJSON): Called from the results the table to show a JSON for the samples of a specific test.
2056 (showSection): Deleted.
2057 (startTest): Deleted.
2058 (showResults): Deleted.
2059 (showJson): Deleted.
2060 (showTestGraph): Deleted.
2061 (showTestJSON): Deleted.
2062 (initialize.toggleTestsCheckbox.onchange): Deleted.
2063 (initialize): Deleted.
2064 (updateSuiteSelection): Deleted.
2065 (updateTestSelection): Deleted.
2066 (updateSuiteCheckbox): Deleted.
2067 (localStorageNameForTest): Deleted.
2068 (populateSettings.): Deleted.
2069 (populateSettings): Deleted.
2071 * Animometer/runner/resources/benchmark-runner.js:
2072 (BenchmarkRunner): Pass the frameContainer element to the BenchmarkRunner.
2073 (BenchmarkRunner.prototype._appendFrame): Remove unused parameter unwanted styling code.
2074 (BenchmarkRunner.prototype.runMultipleIterations): Use the this._client.iterationCount instead of passing it as a parameter also.
2076 * Animometer/runner/resources/graph.js:
2077 (graph): Calculate the size of the chart from the container element.
2079 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js:
2081 * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js:
2082 (BouncingSvgParticlesStage.prototype._createDefs):
2083 (BouncingSvgParticlesStage.prototype._createClipStar):
2084 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js:
2085 (BouncingSvgShape.prototype._createShape):
2086 (BouncingSvgShapesStage.prototype.createGradient):
2087 Call DocumentExtension.createSvgElement() instead of calling Utilities.createSvgElement().
2089 * Animometer/tests/resources/main.js:
2090 (Animator.prototype.animate):
2092 (Benchmark.prototype.update):
2093 * Animometer/tests/resources/stage.js:
2094 (StageBenchmark.prototype.showResults):
2095 Rename the options to match the <input> ids in animometer.html.
2097 * Animometer/tests/resources/utilities.js:
2098 (window.Utilities.createSvgElement): Deleted.
2100 * Animometer/tests/text/layering-text.html:
2101 * Animometer/tests/text/resources/layering-text.js:
2102 (LayeringTextStage):
2103 (LayeringTextStage.prototype._setFontSize): Sets the size of the text dynamically such that they all fit in one stage.
2105 2015-10-29 Simon Fraser <simon.fraser@apple.com>
2107 Animometer computes frame rate incorrectly
2108 https://bugs.webkit.org/show_bug.cgi?id=150698
2110 Reviewed by Tim Horton.
2112 The existing code incremented this._frameCount after checking against this._dropFrameCount.
2113 This has the effect of setting this._measureTimeOffset one frame too late, so
2114 we were measuring only two frames, not three, and thus computing an incorrect fps.
2116 * Animometer/tests/resources/main.js:
2117 (Animator.prototype.animate):
2119 2015-10-27 Jon Lee <jonlee@apple.com>
2121 Add an option to make the graphics benchmark runs a specific test
2122 https://bugs.webkit.org/show_bug.cgi?id=150528
2123 rdar://problem/23246614
2125 Reviewed by Zalan Bujtas.
2127 Add a checkbox that lets the user list all of the available tests, and select
2128 the ones to run repeatedly. The test checkboxes will update the state of the suite
2129 checkbox. The selected tests are stored in localStorage to make it easy to do
2132 * Animometer/runner/animometer.html: Add a checkbox to show individual tests.
2133 Update other markup.
2134 * Animometer/runner/resources/animometer.css: Make the settings area a little wider
2135 to accommodate the longer names of the tests
2136 * Animometer/runner/resources/animometer.js:
2137 (startBenchmark): Change the way that the suites are fed into the benchmark
2138 runner. Go through each of the suites and their tests, and create a new Suite
2139 with just the enabled tests. While enumerating store the enabled tests into
2141 (initialize): Initialization routine (taking over populateSettings). When the
2142 checkbox for showing tests is toggled, add or remove a class on #suites to show
2143 the individual tests.
2144 (updateSuiteSelection): Called whenever the user toggles the checkbox for a suite.
2145 Either select all or none of the tests.
2146 (updateTestSelection): Called whenever the user toggles the checkbox for a test.
2147 (updateSuiteCheckbox): Update the state of the test's suite's checkbox to
2148 indeterminate if there is at least one enabled test, unchecked if none are selected,
2149 and checked if all are selected.
2150 (localStorageNameForTest): Helper function to get the name of the test to use as
2151 a key to localStorage.
2152 (populateSettings): Add the tests for each suite into an inner list.
2154 2015-10-26 Said Abou-Hallawa <sabouhallawa@apple.com>
2156 Add an option to output the results of the graphics benchmark in JSON format
2157 https://bugs.webkit.org/show_bug.cgi?id=150484
2158 <rdar://problem/23243721>
2160 Reviewed by Darin Adler.
2162 * Animometer/resources/extensions.js:
2163 (ResultsDashboard): A new class to hold the iterations results.
2164 (ResultsDashboard.prototype.push): Appends an iteration results;
2165 (ResultsDashboard.prototype.toJSON): Converts the iterations results to JSON format.
2167 (RecordTable.prototype.clear): Clears the results table.
2168 (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
2169 (RecordTable.prototype._showHeader): Shows the table header titles.
2170 (RecordTable.prototype._showEmpty): Shows an empty table cell.
2171 (RecordTable.prototype._showValue): Shows a number value in the results table.
2172 (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
2173 (RecordTable.prototype._showTest): Shows the results of a single test.
2174 (RecordTable.prototype._showSuite): Shows the results of a single suite.
2175 (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
2176 (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
2178 (ResultsTable): RecordTable was renamed to ResultsTable.
2179 (ResultsTable.prototype.clear): Clears the table element.
2180 (ResultsTable.prototype._showHeaderRow): Shows a row in the results table header.
2181 (ResultsTable.prototype._showHeader): Shows the results table header.
2182 (ResultsTable.prototype._showEmpty): Shows an empty table cell.
2183 (ResultsTable.prototype._showText): Shows a string in a new table cell.
2184 (ResultsTable.prototype._showFixedNumber): Shows a number in a new table cell.
2185 (ResultsTable.prototype._showGraph): Shows a button for the sampled data graph.
2186 (ResultsTable.prototype._showJSON): Shows a button for the sampled data JSON.
2187 (ResultsTable.prototype._showTest): Shows the results of a single test.
2188 (ResultsTable.prototype._showSuite): Shows the results of a single suite.
2189 (ResultsTable.prototype._showIteration): Shows the results of a single iteration.
2190 (ResultsTable.prototype.showRecord): Shows a single iteration for a single test.
2191 (ResultsTable.prototype.showIterations): Shows all the results.
2192 (RecordTable): Deleted.
2193 (RecordTable.prototype.clear): Deleted.
2194 (RecordTable.prototype._showTitles): Deleted.
2195 (RecordTable.prototype._showHeader): Deleted.
2196 (RecordTable.prototype._showEmpty): Deleted.
2197 (RecordTable.prototype._showValue): Deleted.
2198 (RecordTable.prototype._showSamples): Deleted.
2199 (RecordTable.prototype._showTest): Deleted.
2200 (RecordTable.prototype._showSuite): Deleted.
2201 (RecordTable.prototype.showRecord): Deleted.
2202 (RecordTable.prototype.showIterations): Deleted.
2204 * Animometer/resources/sampler.js:
2205 (Sampler.prototype.startSampling): Use forEach.
2206 (Sampler.prototype.sample): Use forEach.
2207 (Sampler.prototype.toJSON): Converts the sampler data to JSON format.
2209 * Animometer/resources/strings.js: Added.
2210 This new file will be used to associate the strings used by the benchmark
2211 with IDs. A string can be changed in one place without having to change
2212 all the instances of this string in multiple files. There two groups of
2213 strings in this file. The first one is used by the UI elements and the second
2214 group is used when constructing the results JSON.
2216 * Animometer/runner/animometer.html:
2217 * Animometer/runner/resources/animometer.css:
2219 * Animometer/runner/resources/animometer.js:
2220 (window.benchmarkRunnerClient.willAddTestFrame):
2221 (window.benchmarkRunnerClient.willStartFirstIteration):
2222 (window.benchmarkRunnerClient.didRunSuites):
2223 (window.benchmarkRunnerClient.didFinishLastIteration):
2224 Make benchmarkRunnerClient uses ResultsDashboard instead of _iterationsSamplers
2225 Get the JSON from ResultsDashboard.toJSON() and pass it to ResultsTable.showIterations().
2226 Also set the textContent of the "#json" textarea with the results JSON.
2228 (showResults): Delete unneeded code.
2229 (showJson): Shows the "json" section.
2230 (showTestGraph): Rename showGraph() to be showTestGraph().
2231 (showTestJSON): Shows the JSON of a single testResults.
2232 (showGraph): Deleted.
2234 * Animometer/runner/resources/tests.js:
2235 Use the string table instead of putting literal strings.
2237 * Animometer/tests/resources/stage.js:
2238 (StageBenchmark.prototype.showResults):
2239 Fix the parameters which are passed to RecordTable.showRecord().
2241 * Animometer/tests/bouncing-particles/bouncing-canvas-images.html:
2242 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html:
2243 * Animometer/tests/bouncing-particles/bouncing-css-images.html:
2244 * Animometer/tests/bouncing-particles/bouncing-css-shapes.html:
2245 * Animometer/tests/bouncing-particles/bouncing-svg-images.html:
2246 * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html:
2247 * Animometer/tests/examples/canvas-electrons.html:
2248 * Animometer/tests/examples/canvas-stars.html:
2249 * Animometer/tests/simple/simple-canvas-paths.html:
2250 * Animometer/tests/template/template-canvas.html:
2251 * Animometer/tests/template/template-css.html:
2252 * Animometer/tests/template/template-svg.html:
2253 * Animometer/tests/text/layering-text.html:
2254 Include the new strings.js file in all the test files.
2256 2015-10-12 Jon Lee <jonlee@apple.com>
2258 Add canvas line dash test
2259 https://bugs.webkit.org/show_bug.cgi?id=150078
2260 <rdar://problem/23082347>
2262 Reviewed by Dean Jackson.
2264 * Animometer/runner/resources/tests.js: Add line dash test.
2265 * Animometer/tests/simple/resources/simple-canvas-paths.js:
2266 (CanvasLineDashStage): Create a new stage with a default dash pattern and stroke style.
2267 Maintain a step which will animate the dash.
2268 (CanvasLineDashStage.prototype.animate): Render the line path with the dash. Increment
2269 the dash offset to animate.
2270 (CanvasPathBenchmark.prototype.createStage): Add the test.
2272 2015-10-12 Jon Lee <jonlee@apple.com>
2274 Add canvas line path tests
2275 https://bugs.webkit.org/show_bug.cgi?id=150076
2276 <rdar://problem/23082285>
2278 Reviewed by Dean Jackson.
2280 * Animometer/runner/resources/tests.js: Add new line path tests, with different
2282 * Animometer/tests/simple/resources/simple-canvas-paths.js:
2283 (CanvasLinePathStage): The stage is the same as the SimpleCanvasPathStrokeStage
2284 but sets the lineJoin on the context.
2285 (CanvasPathBenchmark.prototype.createStage): Add the tests.
2287 2015-10-12 Jon Lee <jonlee@apple.com>
2289 Add missing paint objects for arc and arcTo fills
2290 https://bugs.webkit.org/show_bug.cgi?id=150075
2291 <rdar://problem/23082233>
2293 Reviewed by Dean Jackson.
2295 * Animometer/tests/simple/resources/simple-canvas-paths.js: Add missing paint objects
2296 for arcTo and arc segment fills.
2297 (CanvasArcToSegmentFill):
2298 (CanvasArcToSegmentFill.prototype.draw):
2299 (CanvasArcSegmentFill):
2300 (CanvasArcSegmentFill.prototype.draw):
2302 2015-10-12 Jon Lee <jonlee@apple.com>
2304 Add canvas line segment tests
2305 https://bugs.webkit.org/show_bug.cgi?id=150073
2306 <rdar://problem/23082138>
2308 Reviewed by Dean Jackson.
2310 * Animometer/runner/resources/tests.js: Add new line segment tests, with different
2312 * Animometer/tests/simple/resources/simple-canvas-paths.js:
2313 (CanvasLineSegment): Add new line segment paint object.
2314 (CanvasLineSegmentStage): Create a new stage that sets the lineCap.
2316 2015-10-12 Jon Lee <jonlee@apple.com>
2318 Add canvas path fill tests
2319 https://bugs.webkit.org/show_bug.cgi?id=150071
2320 <rdar://problem/23082001>
2322 Reviewed by Dean Jackson.
2324 * Animometer/runner/resources/tests.js: Add new pathTypes for path fills.
2325 * Animometer/tests/simple/resources/simple-canvas-paths.js:
2326 (CanvasLinePoint): Add basic point for a line, and call lineTo.
2327 (SimpleCanvasPathFillStage): Add a new stage similar to SimpleCanvasPathStrokeStage.
2328 (CanvasPathBenchmark.prototype.createStage): Add the tests.
2330 2015-10-12 Jon Lee <jonlee@apple.com>
2332 Add canvas path tests
2333 https://bugs.webkit.org/show_bug.cgi?id=150067
2334 rdar://problem/23081463
2336 Reviewed by Dean Jackson.
2338 * Animometer/runner/resources/tests.js: Add a quadratic and bezier path test.
2340 * Animometer/tests/simple/resources/simple-canvas.js:
2341 (SimpleCanvasStage.prototype.tune): This kind of test joins all of the segments
2342 into one long path, and tries to render that one path. Random points make it
2343 difficult to tell what is going on, so add a parameter to the constructor to
2344 confine the area where the random coordinates can land. The more complicated the
2345 case is, the larger an area the path will cover. Add an artificial minimum so
2346 that the first 200 points aren't confined to a space that is too small.
2348 * Animometer/tests/simple/resources/simple-canvas-paths.js:
2349 (SimpleCanvasPathStrokeStage): Add a new kind of stage that inherits from
2350 SimpleCanvasStage. Each time the frame animates a random line width and stroke
2351 color are chosen. The path setup is done outside of each paint object.
2352 (CanvasQuadraticPoint): This point just calls quadraticCurveTo.
2353 (CanvasPathBenchmark.prototype.createStage): Add the tests.
2355 2015-10-12 Jon Lee <jonlee@apple.com>
2357 Add basic canvas tests
2358 https://bugs.webkit.org/show_bug.cgi?id=150066
2359 rdar://problem/23081143
2361 Reviewed by Dean Jackson.
2363 This adds a new test suite that will cover all of the path-based canvas calls.
2364 The patch will be divided up to cover tests with similar techniques.
2366 The simplest version uses a SimpleCanvasStage.
2368 * Animometer/runner/resources/tests.js: Add tests for quadratic, bezier, arcTo,
2369 arc, and rect segments. Also include arcTo, arc, and rect fills.
2370 * Animometer/tests/resources/stage.js:
2371 (Stage.prototype.randomBool): Added for counterclockwise property for arc segments.
2372 (Stage.prototype.randomInt): Fix how values are rounded, used by randomBool. It should
2373 round instead of flooring everything.
2374 * Animometer/tests/simple/resources/simple-canvas.js: Added. Defines common classes
2375 used by all simple canvas tests. The page reads best bottom to top.
2376 (SimpleCanvasStage): Basic stage. Pass a canvasObject which will be used to create new
2377 objects as needed in tune().
2378 (SimpleCanvasStage.prototype.tune): Modeled on other tests. Adds and removed objects
2379 as specified by the provided |count|.
2380 (SimpleCanvasStage.prototype.animate): Iterate over all the objects and ask them to draw.
2381 There is no "animating" of the objects; they will just paint statically on the canvas.
2382 (SimpleCanvasAnimator): Basic animator clears the canvas prior to painting.
2383 (SimpleCanvasBenchmark): Hard-code the feedback loop parameters instead of including
2384 them in the query parameters to the test URLs.
2385 (SimpleCanvasBenchmark.prototype.createAnimator):
2386 * Animometer/tests/simple/simple-canvas-paths.html: Added.
2388 * Animometer/tests/simple/resources/simple-canvas-paths.js: Added. There is no "animating"
2389 of these objects--they just paint statically on the canvas.
2390 (CanvasQuadraticSegment): Paint a quadratic segment stroke.
2391 (CanvasBezierSegment): Paint a bezier segment stroke.
2392 (CanvasArcToSegment): Paint an arcTo stroke.
2393 (CanvasArcSegment): Paint an arc stroke.
2394 (CanvasRect): Paint a rect.
2395 (CanvasRectFill): Paint a filled rect.
2397 (CanvasPathBenchmark):
2398 (CanvasPathBenchmark.prototype.createStage): Look for the pathType and create the
2399 stage using the right paint object.
2400 (window.benchmarkClient.create):
2402 2015-10-12 Jon Lee <jonlee@apple.com>
2404 Refactor tune() to pass in an integer-based count
2405 https://bugs.webkit.org/show_bug.cgi?id=150060
2406 <rdar://problem/23079425>
2408 Reviewed by Dean Jackson.
2410 All of the tune functions do an initial step of flooring the
2411 # of painting objects to add or remove. Factor that out since
2412 the complexity of all of these tests is always expressed in terms
2415 * Animometer/tests/resources/main.js:
2416 (Benchmark.prototype.update): Update the tuneValue.
2418 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js:
2419 (BouncingParticlesStage.prototype.tune): Remove the count adjustment.
2420 * Animometer/tests/examples/resources/canvas-electrons.js:
2421 (CanvasElectronsStage.prototype.tune): Ditto.
2422 * Animometer/tests/examples/resources/canvas-stars.js:
2423 (CanvasStarsStage.prototype.tune): Ditto.
2424 * Animometer/tests/text/resources/layering-text.js:
2425 (LayeringTextStage.prototype.tune): Ditto.
2427 2015-10-12 Jon Lee <jonlee@apple.com>
2429 Store test-interval in localStorage
2430 https://bugs.webkit.org/show_bug.cgi?id=150055
2431 <rdar://problem/23078879>
2433 Reviewed by Dean Jackson.
2435 * Animometer/runner/resources/animometer.js:
2436 (populateSettings): Keep track of the specified test interval in localStorage
2437 to make it easy to repeat a test suite.
2439 2015-10-12 Jon Lee <jonlee@apple.com>
2441 Remove "../tests/" from the URLs of all tests
2442 https://bugs.webkit.org/show_bug.cgi?id=150054
2443 <rdar://problem/23078784>
2445 Reviewed by Dean Jackson.
2447 Presumably all tests will be running from the tests/ directory,
2448 so we don't have to specify it in all of the test URLs.
2450 * Animometer/runner/resources/benchmark-runner.js:
2451 (BenchmarkRunnerState.prototype.prepareCurrentTest): Prepend
2452 "../tests/" to all tests.
2453 * Animometer/runner/resources/tests.js: Remove "../tests/" from
2456 2015-10-12 Jon Lee <jonlee@apple.com>
2458 Refactor test suites to a separate class.
2459 https://bugs.webkit.org/show_bug.cgi?id=150053
2460 <rdar://problem/23078645>
2462 Reviewed by Dean Jackson.
2464 Create a Suite class to refactor out prepare() and run().
2465 Generate the checkboxes representing the suites using Suites
2466 instead of maintaining a separate list. Also, save the
2467 selections out to localStorage.
2469 * Animometer/runner/animometer.html: Remove the explicitly listed
2470 suites. These will be generated from Suites instead.
2471 * Animometer/runner/resources/animometer.js:
2472 (populateSettings): Iterate through Suites, and create the
2473 label and checkbox. Attach the Suite object to the checkbox so
2474 when the benchmark is started, we get direct access. Initialize
2475 the checkmark based on its value in localStorage. Set this to
2476 run when DOMContentLoaded is dispatched.
2477 (startBenchmark): Grab all of the checkboxes, inspect their
2478 values, add it to enabledSuites if selected. Remember whether
2479 the suite was enabled in localStorage, so that it's easy to do
2481 * Animometer/runner/resources/tests.js:
2482 (Suite): Create a new Suite class. Refactor out prepare() and
2483 run(), since all of them have the same implementation. Populate
2484 Suites with Suite instances instead of generic objects.
2486 2015-10-12 Jon Lee <jonlee@apple.com>
2488 Update graph styles for legibility.
2489 https://bugs.webkit.org/show_bug.cgi?id=150052
2490 <rdar://problem/23078503>
2492 Reviewed by Dean Jackson.
2494 * Animometer/runner/resources/animometer.css: Update colors and
2495 stroke thicknesses to make the graphs easier to read.
2496 (.smaple-time): Correct to .sample-time
2497 * Animometer/runner/resources/graph.js:
2500 2015-10-12 Jon Lee <jonlee@apple.com>
2502 Update graph styles for legibility.
2503 https://bugs.webkit.org/show_bug.cgi?id=150052
2504 <rdar://problem/23078503>
2506 Reviewed by Dean Jackson.
2508 * Animometer/runner/resources/animometer.css: Update colors and
2509 stroke thicknesses to make the graphs easier to read.
2510 (.smaple-time): Correct to .sample-time
2511 * Animometer/runner/resources/graph.js:
2514 2015-10-12 Filip Pizlo <fpizlo@apple.com>
2516 Unreviewed, revert an unintended commit.
2518 * JetStream/Octane2/crypto.js:
2522 2015-10-05 Said Abou-Hallawa <sabouhallawa@apple.com>
2524 Add a graphics benchmark
2525 https://bugs.webkit.org/show_bug.cgi?id=149053
2526 <rdar://problem/18984169>
2528 Reviewed by Dean Jackson.
2530 Instead of measuring the FPS of the animation, this benchmark measures the
2531 test complexity when rendering at a set-point FPS which should be lower
2532 than 60 FPS. This benchmark tries to stay at the set-point FPS by using
2533 a closed loop control system PID function. The gain of the system is passed
2534 as a parameter when running the test. Measuring the FPS faithfully results
2535 very fluctuating values. A Kalman filter is used to give a better estimate
2536 for the current FPS.
2538 The animation of the tests is done manually. requestAnimationFrame() is
2539 called with a callback. Inside this callback, the test is animating by
2540 changing the positions of the elements inside the page. The test complexity
2541 may change also if the current FPS is not equal to the desired FPS.
2543 In this patch, the benchmark and the tests are included. The shared code
2544 and the tests runner are included in separate patches.
2546 * Animometer/runner/animometer.html:
2547 * Animometer/runner/resources/animometer.js:
2548 Add two new examples for more complex animation techniques.
2549 Add an option to show/hide the test running results which is off by default.
2551 * Animometer/runner/resources/tests.js: Added.
2552 (suiteFromName): Returns a suite given its name.
2553 (testFromName): Returns a test given its suite and name.
2555 * Animometer/tests: Added.
2556 This directory includes all the test suites to be run by the benchmark.
2557 runner. All the tests should try to run on three stages: CSS, canvas and
2560 * Animometer/tests/bouncing-particles: Added.
2561 * Animometer/tests/bouncing-particles/resources: Added.
2562 The bouncing particles test is an example of a simple animation technique.
2564 * Animometer/tests/bouncing-particles/bouncing-canvas-images.html: Added.
2565 * Animometer/tests/bouncing-particles/bouncing-canvas-shapes.html: Added.
2566 * Animometer/tests/bouncing-particles/bouncing-css-images.html: Added.
2567 * Animometer/tests/bouncing-particles/bouncing-css-shapes.html: Added.
2568 * Animometer/tests/bouncing-particles/bouncing-svg-images.html: Added.
2569 * Animometer/tests/bouncing-particles/bouncing-svg-shapes.html: Added.
2570 Bouncing particles test pages.
2572 * Animometer/tests/bouncing-particles/resources/bouncing-particles.js: Added.
2573 (BouncingParticle): Base class for a bouncing particle.
2574 (BouncingParticle.prototype.center): Returns the center point or the particle.
2575 (BouncingParticle.prototype.animate): Moves the particle based on its current position, angle and velocity.
2577 (BouncingParticlesAnimator): A sub class of Animator.
2579 (BouncingParticlesStage): Represents the container of all the bouncing particles.
2580 (BouncingParticlesStage.prototype.parseShapeParamters): Gets the shape parameters for shape animating tests.
2581 (BouncingParticlesStage.prototype.randomRotater): Creates a rotater for the particles.
2582 (BouncingParticlesStage.prototype.animate): Animates all the particles.
2583 (BouncingParticlesStage.prototype.tune): Changes the test by adding or removing particles.
2585 (BouncingParticlesBenchmark): Runs the benchmark for bouncing particles test.
2586 (BouncingParticlesBenchmark.prototype.createAnimator): Creates an animator of type BouncingParticlesAnimator.
2588 * Animometer/tests/bouncing-particles/resources/bouncing-css-shapes.js: Added.
2589 (BouncingCssShape): A sub class of BouncingParticle for animating CSS shapes.
2590 (BouncingCssShape.prototype._createSpan): Creates a <span> element and takes the shape and clipping classes into consideration.
2591 (BouncingCssShape.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2592 (BouncingCssShape.prototype.animate): Rotates and moves the shape to a new location.
2594 (BouncingCssShapesStage): A sub class of BouncingParticlesStage for animating CSS shapes.
2595 (BouncingCssShapesStage.prototype.createParticle): Creates a particle of type BouncingCssShape.
2596 (BouncingCssShapesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2598 (BouncingCssShapesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS shapes.
2599 (BouncingCssShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCssShapesStage.
2600 (window.benchmarkClient.create): Creates a benchmark of type BouncingCssShapesBenchmark.
2602 * Animometer/tests/bouncing-particles/resources/bouncing-css-images.js: Added.
2603 (BouncingCssImage): A sub class of BouncingParticle for animating CSS images.
2604 (BouncingCssImage.prototype._move): Move the particle to a new location. Apply transform since it does not require layout.
2605 (BouncingCssImage.prototype.animate): Rotates and moves the shape to a new location.
2607 (BouncingCssImagesStage): A sub class of BouncingParticlesStage for animating CSS images.
2608 (BouncingCssImagesStage.prototype.createParticle): Creates a particle of type BouncingCssImage.
2609 (BouncingCssImagesStage.prototype.particleWillBeRemoved): Removes the corresponding element form the parent children list.
2611 (BouncingCssImagesBenchmark): A sub class of BouncingParticlesBenchmark for animating CSS images.
2612 (BouncingCssImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCssImagesStage.
2613 (window.benchmarkClient.create): Creates a benchmark of type BouncingCssImagesBenchmark.
2615 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-particles.js: Added.
2616 (BouncingCanvasParticle): A base sub-class of BouncingParticle for animating canvas particles.
2617 (BouncingCanvasParticle.prototype._applyRotation): Apply the particle rotation-around-center transform to the canvas context.
2618 (BouncingCanvasParticle.prototype._applyClipping): Apply the particle clipping to the canvas context.
2619 (BouncingCanvasParticle.prototype._draw): A non-implemented version of the drawing function.
2620 (BouncingCanvasParticle.prototype.animate): Carries out all the steps to redraw the canvas particle.
2622 (BouncingCanvasParticlesStage): A base sub-class of BouncingParticlesStage for animating canvas particles.
2624 (BouncingCanvasParticlesAnimator): A concrete sub-class of BouncingParticlesAnimator for animating canvas particles.
2625 (BouncingCanvasParticlesAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2627 (BouncingCanvasParticlesBenchmark): A base sub-class of StageBenchmark for animating canvas particles.
2628 (BouncingCanvasParticlesBenchmark.prototype.createAnimator): Creates the canvas particles animator.
2630 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-shapes.js: Added.
2631 (BouncingCanvasShape): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2632 (BouncingCanvasShape.prototype._applyFill): Sets the fillStyle in the canvas context.
2633 (BouncingCanvasShape.prototype._drawShape): Carries out the actual drawing.
2634 (BouncingCanvasShape.prototype._draw): Carries out all the steps to draw the shape.
2636 (BouncingCanvasShapesStage): A concrete sub-class of BouncingCanvasParticle for animating canvas shapes.
2637 (BouncingCanvasShapesStage.prototype.createParticle): Creates a particle of type BouncingCanvasShape.
2639 (BouncingCanvasShapesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas shapes.
2640 (BouncingCanvasShapesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasShapesStage.
2641 (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasShapesBenchmark.
2643 * Animometer/tests/bouncing-particles/resources/bouncing-canvas-images.js: Added.
2644 (BouncingCanvasImage): A concrete sub-class of BouncingCanvasParticle for animating canvas images.
2645 (BouncingCanvasImage.prototype._draw): Draws an image on the context of a canvas.
2647 (BouncingCanvasImagesStage): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2648 (BouncingCanvasImagesStage.prototype.createParticle): Creates a particle of type BouncingCanvasImage.
2650 (BouncingCanvasImagesBenchmark): A concrete sub-class of BouncingCanvasParticlesBenchmark for animating canvas images.
2651 (BouncingCanvasImagesBenchmark.prototype.createStage): Creates a stage of type BouncingCanvasImagesStage.
2652 (window.benchmarkClient.create): Creates a benchmark of type BouncingCanvasImagesBenchmark.
2654 * Animometer/tests/bouncing-particles/resources/bouncing-svg-particles.js: Added.
2655 (BouncingSvgParticle): A base sub-class of BouncingParticle for animating SVG particles.
2656 (BouncingSvgParticle.prototype._applyClipping): Apply the particle clipping by setting the 'clip-path' attribute of the SVGElement.
2657 (BouncingSvgParticle.prototype._move): Moves the particle to a new location. Apply transform since it does not require layout.
2658 (BouncingSvgParticle.prototype.animate): Rotates and moves the shape to a new location.
2659 (BouncingSvgParticlesStage): A sub class of BouncingParticlesStage for animating SVGElements.
2660 (BouncingSvgParticlesStage.prototype._createDefs): Creates an SVGDefsElement.
2661 (BouncingSvgParticlesStage.prototype._ensureDefsIsCreated): Ensures there is only one SVGDefsElement is created.
2662 (BouncingSvgParticlesStage.prototype._createClipStar): Creates an SVGClipPathElement and sets its 'd' attribute to a star like shape.
2663 (BouncingSvgParticlesStage.prototype.ensureClipStarIsCreated): Ensure there is only one star SVGClipPathElement is created.
2664 (BouncingSvgParticlesStage.prototype.particleWillBeRemoved): Remove the corresponding element form the parent children list.
2666 * Animometer/tests/bouncing-particles/resources/bouncing-svg-shapes.js: Added.
2667 (BouncingSvgShape): A concrete sub-class of BouncingSVGParticle for animating SVG shapes.
2668 (BouncingSvgShape.prototype._createShape): Creates an SVG shape.
2669 (BouncingSvgShape.prototype._applyFill): Applies the selected fill style to the SVG shape.
2671 (BouncingSvgShapesStage): A concrete sub-class of BouncingSvgParticlesStage for animating SVG shapes.
2672 (BouncingSvgShapesStage.prototype.createGradient): Creates an SVGLinearGradientElement.
2673 (BouncingSvgShapesStage.prototype.createParticle): Creates a particle of type BouncingSvgShape.
2674 (BouncingSvgShapesStage.prototype.particleWillBeRemoved): Ensures the attached SVGLinearGradientElement is removed from the SVGDefsElement.
2676 (BouncingSvgShapesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2677 (BouncingSvgShapesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgShapesStage.
2678 (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgShapesBenchmark.
2680 * Animometer/tests/bouncing-particles/resources/bouncing-svg-images.js: Added.
2681 (BouncingSvgImage): A concrete sub-class of BouncingSVGParticle for animating SVG images.
2683 (BouncingSvgImagesStage): A concrete sub-class of BouncingSVGParticlesBenchmark for animating SVG images.
2684 (BouncingSvgImagesStage.prototype.createParticle): Creates a particle of type BouncingSvgImage.
2686 (BouncingSvgImagesBenchmark): A concrete sub-class of BouncingParticlesBenchmark for animating SVG images.
2687 (BouncingSvgImagesBenchmark.prototype.createStage): Creates a stage of type BouncingSvgImagesStage.
2688 (window.benchmarkClient.create): Creates a benchmark of type BouncingSvgImagesBenchmark.
2690 * Animometer/tests/examples: Added.
2691 * Animometer/tests/examples/canvas-electrons.html: Added.
2692 * Animometer/tests/examples/canvas-stars.html: Added.
2693 Examples test pages.
2695 * Animometer/tests/examples/resources: Added.
2696 * Animometer/tests/examples/resources/canvas-electrons.js: Added.
2697 (CanvasElectron): An object which draws and animate a electron object on a canvas stage.
2698 (CanvasElectron.prototype._draw): Draws the electron object.
2699 (CanvasElectron.prototype.animate): Animates the electron object.
2701 (CanvasElectronsStage): A concrete sub-class of Stage for animating electrons.
2702 (CanvasElectronsStage.prototype.tune): Changes the test by adding or removing elements.
2703 (CanvasElectronsStage.prototype.animate): Animates the test elements.
2705 (CanvasElectronsAnimator): A concrete sub-class of StageAnimator for animating canvas electrons.
2706 (CanvasElectronsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2708 (CanvasElectronsBenchmark): A concrete sub-class of StageBenchmark for animating electrons.
2709 (CanvasElectronsBenchmark.prototype.createStage): Creates a stage of CanvasElectronsStage.
2710 (CanvasElectronsBenchmark.prototype.createAnimator): Creates an animator of type CanvasElectronsAnimator.
2711 (window.benchmarkClient.create): Creates a benchmark of type CanvasElectronsBenchmark.
2713 * Animometer/tests/examples/resources/canvas-stars.js: Added.
2714 (CanvasStar): An object which draws and animate a star object on a canvas stage.
2715 (CanvasStar.prototype._draw): Draws the star object.
2716 (CanvasStar.prototype.animate): Animates the star object.
2718 (CanvasStarsStage): A concrete sub-class of Stage for animating stars.
2719 (CanvasStarsStage.prototype.tune): Changes the test by adding or removing elements.
2720 (CanvasStarsStage.prototype.animate): Animates the test elements.
2722 (CanvasStarsAnimator): A concrete sub-class of StageAnimator for animating canvas stars.
2723 (CanvasStarsAnimator.prototype.animate): Overrides the base class method to clear the canvas before redrawing the stage.
2725 (CanvasStarsBenchmark): A concrete sub-class of Benchmark for animating stars.
2726 (CanvasStarsBenchmark.prototype.createStage): Creates a stage of CanvasStarsStage.
2727 (CanvasStarsBenchmark.prototype.createAnimator): Creates an animator of type CanvasStarsAnimator.
2728 (window.benchmarkClient.create): Creates a benchmark of type CanvasStarsBenchmark.
2730 * Animometer/tests/resources: Added.
2731 This directory includes the script which is required to run an adaptive
2732 graphics benchmark. From an empty test page, the set of classes in this
2733 directory are responsible for measuring the current frame rate and
2734 changing the test to reach a desired FPS. It keeps asking the test page
2735 to tune itself by a certain value to increase or decrease the frame rate.
2736 It's also responsible for sampling the test state and the corresponding
2739 * Animometer/tests/resources/main.js: Added.
2740 (BenchmarkState): Tracks the state of the benchmark test.
2741 (BenchmarkState.prototype._timeOffset): Returns the timeOffset of a stage.
2742 (BenchmarkState.prototype._message): Returns the message of a stage.
2743 (BenchmarkState.prototype.update): Sets the currentTimeOffset to a new value.
2744 (BenchmarkState.prototype.samplingTimeOffset): Returns the timeOffset of the sampling stage.
2745 (BenchmarkState.prototype.currentStage): Returns the current stage of the benchmark.
2746 (BenchmarkState.prototype.currentMessage): Returns the message of the current stage and timeOffset.
2747 (BenchmarkState.prototype.currentProgress): Returns a percentage of how much the benchmark is running.
2749 (Animator): Manages animating the test.
2750 (Animator.prototype.start): Called if animating using setInterval is requested.
2751 (Animator.prototype.timeDelta): Returns the current timeDelta
2752 (Animator.prototype.animate): Manages the test animation.
2753 (Animator.prototype.animateLoop): Called if animating using requestAnimationFrame is requested.
2755 (Benchmark): Manages running the test benchmark and recording the sampled data.
2756 (Benchmark.prototype.start): Starts the benchmark.
2757 (Benchmark.prototype.update): Called from the animator.animate() to change the complexity of the test.
2758 (Benchmark.prototype.record): Shows the current (not final) results of the benchmark.
2759 (Benchmark.prototype.resolveWhenFinished): Spins until the benchmark is finished and returns its results.
2760 (Benchmark.prototype.run): Starts the test, runs it, waits until it is finished and return its results.
2761 (window.runBenchmark): Called from the benchmark runner through the suite controller run-callback.
2763 * Animometer/tests/resources/math.js: Added.
2764 (Matrix): A matrix object.
2765 (Vector3): A vector of size 3 object.
2766 (Matrix3): A matrix of size 3x3 object.
2768 (PIDController): Closed-loop controller for a set-point y.
2769 (PIDController.prototype._sat): Limits the output to a certain range.
2770 (PIDController.prototype.tune): Given the current output of a system, it produces a new pid value for tuning it.
2772 (KalmanEstimator): Implement Kalman filter to get an estimate for a sampled data point.
2773 (KalmanEstimator.prototype.estimate): Returns an estimate for for a sampled data point.
2775 * Animometer/tests/resources/utilities.js: Added.
2776 (window.Utilities._parse): Given a separator character, it pareses a string to a set of <key, value> pairs.
2777 (window.Utilities.parseParameters): Parses a test parameters.
2778 (window.Utilities.parseArguments): Parses a tag arguments.
2779 (window.Utilities.extendObject): Adds the attributes and their values of an object to another object.
2780 (window.Utilities.copyObject): Copies the attributes and their values of an object to a new object.
2781 (window.Utilities.mergeObjects): Copies the attributes and their values of two objects to a new object.
2782 (window.Utilities.createSvgElement): Creates an SVGElement given its name and its attributes.
2784 * Animometer/tests/resources/stage.css: Added.
2785 * Animometer/tests/resources/stage.js: Added.
2786 (Rotater): Manages rotating an angle within a fixed time interval.
2787 (Rotater.prototype.get interval): Returns the time interval which is required to rotate 360 degrees.
2788 (Rotater.prototype.next): Moves the current time by a delta.
2789 (Rotater.prototype.degree): Returns the current rotating degree.
2790 (Rotater.prototype.rotateZ): Returns CSS formatted transform rotateZ() string for the current degree.
2791 (Rotater.prototype.rotate): Returns SVG formatted transform rotate() string for the current degree.
2793 (Stage): A base class for managing the test complexity and test animation.
2794 (Stage.prototype.get size): Returns the size of the stage excluding the CSS padding.
2795 (Stage.prototype.random): Returns a random float.
2796 (Stage.prototype.randomInt): Returns a random integer.
2797 (Stage.prototype.randomPosition): Returns a random position.
2798 (Stage.prototype.randomSquareSize): Returns a square size.
2799 (Stage.prototype.randomVelocity): Returns a random velocity.
2800 (Stage.prototype.randomAngle): Returns a random angle.
2801 (Stage.prototype.randomColor): Returns a random color not too dark and not too light.
2802 (Stage.prototype.randomRotater): Creates a random rotater. Its velocity depends on choosing a random rotation time interval.
2803 (Stage.prototype.tune): A not-implemented version of this function.
2804 (Stage.prototype.animate): A not-implemented version of this function.
2805 (Stage.prototype.clear): Clears the stage from all its animation elements.
2807 (StageAnimator): A base class for the stage-based animators.
2808 (StageAnimator.prototype.animate): Calls Animator.animate() which updates the test page and then calls Stage.animate() to force redraw.
2810 (StageBenchmark): A base class for the stage-based benchmarks.
2811 (StageBenchmark.prototype.createStage): Creates the default stage.
2812 (StageBenchmark.prototype.createAnimator): Creates the default animator.
2813 (StageBenchmark.prototype.tune): Delegates the call to stage.
2814 (StageBenchmark.prototype.clear): Delegates the call to stage.
2815 (StageBenchmark.prototype.showResults): Shows the results/progress through its recordTable and progressBar.
2817 * Animometer/tests/resources/yin-yang.png: Added.
2818 * Animometer/tests/resources/yin-yang.svg: Added.
2819 These images are shared among all the tests.
2821 * Animometer/tests/template: Added.
2822 * Animometer/tests/template/resources: Added.
2823 This directory includes template tests which do nothing. They can be used
2824 to author new tests. Animated items can be created, moved and redrawn by
2825 removing the TODO comments in the script files and writing actual code.
2827 * Animometer/tests/template/template-css.html: Added.
2828 * Animometer/tests/template/template-canvas.html: Added.
2829 * Animometer/tests/template/template-svg.html: Added.
2830 Template test pages. They can be used as they are. CSS attributes or hidden
2831 elements can be added to these derived test pages if needed.
2833 * Animometer/tests/template/resources/template-css.js: Added.
2835 (TemplateCssStage): A stage to create and animate HTMLElements.
2836 (TemplateCssStage.prototype.tune): Changes the test by adding or removing elements.
2837 (TemplateCssStage.prototype.animate): Animates the test elements.
2838 (TemplateCssBenchmark):
2839 (TemplateCssBenchmark.prototype.createStage): Creates the test stage.
2840 (window.benchmarkClient.create): Creates a benchmark of type TemplateCssBenchmark.
2842 * Animometer/tests/template/resources/template-canvas.js: Added.
2843 (TemplateCanvasObject):
2844 (TemplateCanvasObject.prototype._draw): Draws the objects on the canvas context.
2845 (TemplateCanvasObject.prototype.animate): Moves and redraws the object.
2846 (TemplateCanvasStage): A stage to create and animate drawing elements.
2847 (TemplateCanvasStage.prototype.tune): hanges the test by adding or removing elements.
2848 (TemplateCanvasStage.prototype.animate): Animates the test elements.
2849 (TemplateCanvasAnimator.prototype.animate): Starts the animation every frame.
2850 (TemplateCanvasBenchmark):
2851 (TemplateCanvasBenchmark.prototype.createStage): Creates a stage of type TemplateCanvasStage.
2852 (TemplateCanvasBenchmark.prototype.createAnimator): Creates a animator of type TemplateCanvasAnimator.
2853 (window.benchmarkClient.create): Creates a benchmark of type TemplateCanvasBenchmark.
2855 * Animometer/tests/template/resources/template-svg.js: Added.
2856 (TemplateSvgStage): A stage to create and animate SVGElements.
2857 (TemplateSvgStage.prototype.tune): Changes the test by adding or removing elements.
2858 (TemplateSvgStage.prototype.animate): Animates the test elements.
2859 (TemplateSvgBenchmark.prototype.createStage): Creates a stage of type TemplateSvgStage.
2860 (window.benchmarkClient.create): Creates a benchmark of type TemplateSvgBenchmark.
2862 * Animometer/tests/text: Added.
2863 * Animometer/tests/text/resources: Added.
2864 This directory includes the text animating tests which currently runs
2867 * Animometer/tests/text/layering-text.html: Added.
2870 * Animometer/tests/text/resources/layering-text.js: Added.
2871 (LayeringTextStage): Represents the container of all the stacked text layers.
2872 (LayeringTextStage.parseTextItem): Parses a textItem which may be an opening tag, a closing tag or a self-closing tag.
2873 (LayeringTextStage.isOpeningTextItem): Returns true if the textItem is an opening tag e.g. '<ol>'.
2874 (LayeringTextStage.isClosingTextItem): Returns true if the textItem is an closing tag e.g. '</ol>.
2875 (LayeringTextStage.textItemsFlags.LayeringTextStage.textItems.map): Calculates and stores isOpening and isClosing flags for each textItem.
2876 (LayeringTextStage.isColorableTextItem): Returns true if the textItem is self-closing tag e.g. '<p>...</p>'.
2877 (LayeringTextStage.isInsertableTextItem): Returns true if the textItems causes a new element to be added to the text layers.
2878 (LayeringTextStage.colorableTextItems.LayeringTextStage.textItemsFlags.filter): Number of colorable textItems.
2879 (LayeringTextStage.insertableTextItems.LayeringTextStage.textItemsFlags.filter): Number of insertable textItems.
2880 (LayeringTextStage.colorIndexToTextElementIndex): Maps from colorIndex [0..colorableTextItems-1] to textElementIndex [0..insertableTextItems-1].
2881 (LayeringTextStage.prototype._nextTextItem): Moves the _textItemIndex one step forward in a loop [0..LayeringTextStage.textItems.length-1].
2882 (LayeringTextStage.prototype._previousTextItem): Moves the _textItemIndex one step backward in a loop.
2883 (LayeringTextStage.prototype._pushTextElement): Creates a new textItemElement and adds it to the topmost container <div>.
2884 (LayeringTextStage.prototype._popTextElement): Removes the last textItemElement from the topmost container <div>.
2885 (LayeringTextStage.prototype._colorTextItem): Changes the background color of a single colorable textElement. The index advances in a circle [0..colorableTextItems-1].
2886 (LayeringTextStage.prototype.animate): Changes the background color and the text color of the textElements such that a redraw is enforced.
2887 (LayeringTextStage.prototype.tune): Adds or removes textElements to the stage.
2889 (LayeringTextBenchmark): Runs the benchmark for the layering text test.
2890 (LayeringTextBenchmark.prototype.createStage): Creates a stage of type LayeringTextStage.
2891 (window.benchmarkClient.create): Creates a benchmark of type LayeringTextBenchmark.
2893 2015-10-02 Said Abou-Hallawa <sabouhallawa@apple.com>
2895 Add shared code for a new a graphics benchmark
2896 https://bugs.webkit.org/show_bug.cgi?id=149691
2898 Reviewed by Ryosuke Niwa.
2900 This set of classes will be shared and used by the tests and the runner
2901 of a new graphics benchmark.
2903 * Animometer/resources: Added.
2904 * Animometer/resources/algorithm.js: Added.
2905 (Array.prototype.swap): Swaps two elements in an array.
2906 (Heap): Binary Min/Max Heap object
2907 (Heap.prototype._parentIndex): Given the child node index, it returns the parent index.
2908 (Heap.prototype._leftIndex): Given the parent node index, it returns the left node index.
2909 (Heap.prototype._rightIndex): Given the parent node index, it returns the right node index.
2910 (Heap.prototype._childIndex): Given the parent node index, it returns the child index that may violate the heap property.
2911 (Heap.prototype.init): Initializes the heap state.
2912 (Heap.prototype.top): Returns the value stored at the top of the heap.
2913 (Heap.prototype.push): Pushes a new node at the top of the heap.
2914 (Heap.prototype.pop): Extracts the top node of the heap.
2915 (Heap.prototype._bubble): Fixes the heap property by moving upward.
2916 (Heap.prototype._sink): Fixes the heap property by moving downward.
2917 (Heap.prototype.str): Prints the nodes of the heap to a string.
2918 (Heap.prototype.values): Returns the last "size" heap elements values.
2920 (Algorithm.createMinHeap): Creates a size-bounded min-heap object.
2921 (Algorithm.createMaxHeap): Creates a size-bounded max-heap object.
2923 * Animometer/resources/extensions.js: Added.
2924 (Point): Point object but can be used as size also.
2925 (Point.pointOnCircle): Given, the radius of the circle and the angle of the point, it returns a point object.
2926 (Point.pointOnEllipse): Given, the radiuses of the ellipse and the angle of the point, it returns a point object.
2927 (Point.prototype.get width): Should be called when the point is used as size.
2928 (Point.prototype.get height): Should be called when the point is used as size.
2929 (Point.prototype.get center): Should be called when the point is used as size.
2930 (Point.prototype.add): Returns a new point = this + other.
2931 (Point.prototype.subtract): Returns a new point = this - other.
2932 (Point.prototype.multiply): Returns a new point = this * other.
2933 (Point.prototype.move): Moves the point in a given direction, velocity, time period.
2935 (Insets): Represents borders of a container.
2936 (Insets.prototype.get width): Returns left + right.
2937 (Insets.prototype.get height): Returns top + bottom.
2940 (SimplePromise.prototype.then):
2941 (SimplePromise.prototype.resolve):
2942 Moved from Animometer/runner/resources/benchmark-runner.js since tests also need it.
2944 (Options): Benchmark running options as they are set by the user.
2946 (ProgressBar): Manages a progress bar element. The progress bar is divided into equal length ranges.
2947 (ProgressBar.prototype._progressToPercent): Converts the progress into a percentage.
2948 (ProgressBar.prototype.incRange): Moves to the next range (a range is the running time of a single test).
2949 (ProgressBar.prototype.setPos): Draws the current progress in the current range.
2951 (RecordTable): Shows the results of running a benchmark in a tabular form.
2952 (RecordTable.prototype.clear): Clears the results table.
2953 (RecordTable.prototype._showTitles): Shows the header titles and appends the sub-titles to a queue.
2954 (RecordTable.prototype._showHeader): Shows the table header titles.
2955 (RecordTable.prototype._showEmpty): Shows an empty table cell.
2956 (RecordTable.prototype._showValue): Shows a number value in the results table.
2957 (RecordTable.prototype._showSamples): Shows a button for the sampled data graph.
2958 (RecordTable.prototype._showTest): Shows the results of a single test.
2959 (RecordTable.prototype._showSuite): Shows the results of a single suite.
2960 (RecordTable.prototype.showRecord): Shows a single iteration for a single test.
2961 (RecordTable.prototype.showIterations): Shows the results of all the suites of the iterations.
2963 * Animometer/resources/sampler.js: Added.
2964 (Statistics.sampleMean): Returns the sample mean.
2965 (Statistics.unbiasedSampleStandardDeviation): Returns the unbiased sample variance (i.e. with Bessel's correction)
2966 (Statistics.geometricMean): Returns the geometric mean.
2968 (Experiment): Represents a sampling experiment.
2969 (Experiment.prototype._init): Called when the object is created and when startSampling() is called.
2970 (Experiment.prototype.startSampling): Called after warmup period. Restarts collecting sampled data points.
2971 (Experiment.prototype.sample): Add a new data point.
2972 (Experiment.prototype.mean): Returns the sample mean for the current sampled data points.
2973 (Experiment.prototype.standardDeviation): Returns the sample standard deviation for the current sampled data points.
2974 (Experiment.prototype.percentage): Returns the percentage of the standard deviation divided to the mean.
2975 (Experiment.prototype.confidenceIntervalDelta): Calculates the confidence delta for the current sampled data given a confidence level.
2976 (Experiment.prototype.concern): Returns the average of the worst given percentage from the sampled data.
2977 (Experiment.prototype.score): Returns a score for the sampled data. It is the geometric mean of sampleMean and concern.
2979 (Sampler): Represents a compound experiment. It manages sampling multiple data points at the same time offset.
2980 (Sampler.prototype.startSampling): Called after warming up period. Restarts collecting sampled data points.
2981 (Sampler.prototype.sample): Add a new data vector at a given time offset.
2983 2015-10-02 Said Abou-Hallawa <sabouhallawa@apple.com>
2985 Add the test runner for a new a graphics benchmark
2986 https://bugs.webkit.org/show_bug.cgi?id=149683
2988 Reviewed by Ryosuke Niwa.
2990 The test runner collects the selected test suites and the running options
2991 from its home page. It loops through all the tests, runs them and collects
2992 their running results. At the end, it shows summary results and a final
2993 score. It can also show a chart for a test sampled data.
2995 * Animometer: Added.
2996 * Animometer/runner: Added.
2997 * Animometer/runner/resources: Added.
2999 * Animometer/runner/animometer.html: Added.
3000 * Animometer/runner/resources/animometer.css: Added.
3001 The benchmark runner page and css.
3003 * Animometer/runner/resources/animometer.js: Added.
3004 (window.benchmarkRunnerClient.willAddTestFrame): Called after the test <iframe> is created.
3005 (window.benchmarkRunnerClient.didRunTest): Called after running a test is finished.
3006 (window.benchmarkRunnerClient.willStartFirstIteration): Called at the beginning before running any test.
3007 (window.benchmarkRunnerClient.didRunSuites): Called after running all tests of a suite.
3008 (window.benchmarkRunnerClient.didFinishLastIteration): Called after running the last test.
3010 (showSection): Shows a section in the animometer.html page.
3011 (startTest): Called when the "Start Test" button is clicked.
3012 (showResults): Called after finishing all the tests.
3013 (showGraph): Called when "Click..." button in the "Samples" column of the results table is clicked
3015 * Animometer/runner/resources/benchmark-runner.js: Copied from PerformanceTests/Speedometer/resources/benchmark-runner.js.
3016 (BenchmarkRunnerState): Tracks the current running <suite, test>
3017 (BenchmarkRunnerState.prototype.currentSuite): Returns the current running suite.
3018 (BenchmarkRunnerState.prototype.currentTest): Returns the current running test.
3019 (BenchmarkRunnerState.prototype.isFirstTest): Returns true if we are running the first test in the current suite.
3020 (BenchmarkRunnerState.prototype.next): Advances to the next test.
3021 (BenchmarkRunnerState.prototype.prepareCurrentTest): Creates a new <iframe> and waits for it to load a test.
3023 (BenchmarkRunner): Manages running the tests and communicating with the benchmarkRunnerClient.
3024 (BenchmarkRunner.prototype.waitForElement): Waits for an element to be created.
3025 (BenchmarkRunner.prototype._appendFrame): Creates a new <iframe> element.
3026 (BenchmarkRunner.prototype._removeFrame): Removed the current <iframe> element.
3027 (BenchmarkRunner.prototype._runTestAndRecordResults): Runs the current test and saves its results.
3028 (BenchmarkRunner.prototype.step): Either runs the current test if there is or start a new iteration.
3029 (BenchmarkRunner.prototype.runAllSteps): Loops to run all the tests and move to the next iteration.
3030 (this._runNextIteration): Starts a new iteration or show the results.
3031 (BenchmarkRunner.prototype.runMultipleIterations): Loops to run all the iterations and show the results
3032 (BenchmarkRunner.prototype._finalize): Finalizes the current iteration and starts a new one.
3034 (SimplePromise): Deleted.
3035 (SimplePromise.prototype.then): Deleted.
3036 (SimplePromise.prototype.resolve): Deleted.
3037 (BenchmarkTestStep): Deleted.
3038 (Fibonacci): Deleted.
3039 SimplePromise was moved t Animometer/resources/extensions.js because it is used by the runner and the tests.
3041 (BenchmarkRunner.prototype._waitAndWarmUp): Deleted.
3042 (BenchmarkRunner.prototype._runTest): Deleted.
3043 (BenchmarkState.prototype.currentSuite): Deleted.
3044 (BenchmarkState.prototype.currentTest): Deleted.
3045 (BenchmarkState.prototype.next): Deleted.
3046 (BenchmarkState.prototype.isFirstTest): Deleted.
3047 (BenchmarkState.prototype.prepareCurrentSuite): Deleted.
3048 BenchmarkState was renamed to BenchmarkRunnerState to not be confused with the tests BenchmarkState.
3050 * Animometer/runner/resources/d3.min.js: Copied from Websites/perf.webkit.org/public/v2/js/d3/d3.min.js.
3051 Needed for drawing charts for the sampled scores and frame rates.
3053 * Animometer/runner/resources/graph.js: Added.
3054 (graph): Draws a chart for a test sampled data. It shows two y-axes: one for the animated items and the second for FPS.
3056 * Skipped: Skip the Animometer benchmark for now.
3058 2015-08-27 Csaba Osztrogonác <ossy@webkit.org>
3060 [EFL] REGRESSION(r188793): It made 200 layout tests and Bindings/event-target-wrapper.html performance test fail
3061 https://bugs.webkit.org/show_bug.cgi?id=148470
3063 Unreviewed gardening, skip the hanging test to make the performance bot work.
3067 2015-08-17 Chris Dumez <cdumez@apple.com>
3069 Add performance tests for traversal of collections returned by getElementsByClassName() / getElementsByTagName()
3070 https://bugs.webkit.org/show_bug.cgi?id=148080
3072 Reviewed by Antti Koivisto.
3074 Add performance tests for traversal of *uncached* collections returned
3075 by getElementsByClassName() / getElementsByTagName(). These methods
3076 will soon be updated to return an HTMLCollection instead of a
3077 NodeList and we need to make sure we don't regress performance in the
3080 * DOM/get-elements-by-class-name-traversal-uncached.html: Added.
3081 * DOM/get-elements-by-tag-name-traversal-uncached.html: Added.
3083 2015-08-14 Chris Dumez <cdumez@apple.com>
3085 Add performance tests for NodeList and HTMLCollection traversal
3086 https://bugs.webkit.org/show_bug.cgi?id=148043
3088 Reviewed by Gavin Barraclough.
3090 Add performance tests for NodeList and HTMLCollection traversal.
3091 Ideally, those 2 tests should be as fast. However, due to inefficiencies
3092 in our HTMLCollection bindings code, the HTMLCollection tests is ~30%
3093 slower. This will be addressed in the near future.
3095 * Bindings/childNodes-traversal.html: Added.
3096 * Bindings/children-traversal.html: Added.
3098 2015-08-05 Myles C. Maxfield <mmaxfield@apple.com>
3100 Add a second font-fallback performance test
3101 https://bugs.webkit.org/show_bug.cgi?id=147692
3103 Reviewed by Ryosuke Niwa.
3105 This test is smaller, but has more realistic content. Also, it uses the "lang" attribute.
3107 * Layout/font-fallback-2.html: Added.
3108 * Layout/resources/font-fallback-2.html: Added.
3110 2015-07-13 Filip Pizlo <fpizlo@apple.com>
3112 Update JetStream version number to 1.1.
3114 Rubber stamped by Ryosuke Niwa.
3116 * JetStream/create.rb:
3118 2015-06-30 Filip Pizlo <fpizlo@apple.com>
3120 Update the JetStream documentation to reflect the recent changes
3121 https://bugs.webkit.org/show_bug.cgi?id=146474
3123 Reviewed by Geoffrey Garen.
3125 * JetStream/create.rb: Bump the version.
3126 * JetStream/in-depth-TEMPLATE.html: Add cdjs documentation. Remove cordic documentation. Change documentation for splay and mandreel.
3128 2015-06-26 Filip Pizlo <fpizlo@apple.com>
3130 [JetStream] Raise the percentile of mandreel-latency and splay-latency
3131 https://bugs.webkit.org/show_bug.cgi?id=146378
3133 Reviewed by Mark Lam.
3135 The current percentile is 95%. When I looked at the sample lists in our GC, it was
3136 clear that the worst 5% samples completely amortize our GC pauses. Our GC pauses can
3137 be quite bad. Clearly, splay-latency is meant to test whether we have an incremental
3138 GC that ensures that you don't have bad worst-case pauses. But 95% is too small,
3139 because it doesn't really capture those pauses. Raising the percentile to above 99%
3140 appears to do the trick. 99.5% or more seems like a good bet. The trade-off there is
3141 just that if we set it too high, then we won't have enough statistics. Doing this very
3142 clearly rewards GCs that are incremental, and punishes GCs that aren't (like ours).
3143 That's what we want, since in the future we want to use this test to guide any
3144 improvements to the worst-case performance of our GC.
3146 The way that the percentile is selected will also affect mandreel-latency. That's a
3147 good thing, because 95% is probably too low for that test as well. That test ends up
3148 with >10k samples. The goal of using 95% in the first place was to get enough samples
3149 to have a stable average. But if we have >10k samples, we can push that percentile up
3150 much higher and still get good statistics while achieving the effect we want - i.e.
3151 getting the worst case.
3153 I don't think that we need to do the same thing for cdjs. That test only takes 200
3154 samples, so 95% means we report the average of the worst 10 samples. That's probably
3157 * JetStream/Octane2/base.js: Raise the percentile as described above.
3158 (BenchmarkSuite.prototype.RunSingleBenchmark):
3159 * JetStream/Reference.js: Tweak the reference times to bring the latency tests closer to 100ish on my machine.
3160 * JetStream/create.rb: Bump the version.
3162 2015-06-19 Filip Pizlo <fpizlo@apple.com>
3164 Run CDjs as part of JSC stress testing
3165 https://bugs.webkit.org/show_bug.cgi?id=146174
3167 Reviewed by Geoffrey Garen.
3169 * 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.
3170 * JetStream/cdjs/main.js: Mark this as a slow test.
3171 * JetStream/create.rb: Don't copy the JSC stress tests artifacts into the JetStream bundle.
3173 2015-06-19 Filip Pizlo <fpizlo@apple.com>
3175 Unreviewed, fix a small indentation goof.
3177 * JetStream/cdjs/motion.js:
3178 (Motion.prototype.findIntersection):
3180 2015-06-19 Filip Pizlo <fpizlo@apple.com>
3182 JetStream should include a JavaScript version of the CDx real-time benchmark
3183 https://bugs.webkit.org/show_bug.cgi?id=146156
3185 Reviewed by Geoffrey Garen.
3187 This adds a JavaScript port of the CDx real-time benchmark to JetStream, and retires
3188 the cordic test because it was previously the smallest and probably least interesting.
3190 The new test, "cdjs", is mostly a faithful rewrite of the Java code into JavaScript.
3191 I got the Java code from https://www.cs.purdue.edu/sss/projects/cdx/.
3193 There are some differences:
3195 - It uses RedBlackTree's for all sets and maps rather than hashtables. This is clearly
3196 more in the spirit of real-time than the CDx benchmark. FWIW, CDx used to use trees
3197 and I don't know why that changed in the latest version.
3199 - CDjs doesn't attempt to avoid memory allocations, unlike the real-time Java version.
3200 I wrote the code that I wanted to write for aesthetics, rather than the code that I