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