From 1e2a0e6d90a2f6529408aef29bd9354f8e8fa554 Mon Sep 17 00:00:00 2001 From: Martin Staffa Date: Mon, 1 Feb 2016 18:26:00 +0100 Subject: [PATCH] chore(benchpress): add ngRepeat animation benchmark --- .../repeat-animate-bp/app-classfilter.js | 9 ++ benchmarks/repeat-animate-bp/app-noanimate.js | 6 + benchmarks/repeat-animate-bp/app.js | 7 + benchmarks/repeat-animate-bp/bp.conf.js | 20 +++ benchmarks/repeat-animate-bp/common.js | 122 ++++++++++++++++++ benchmarks/repeat-animate-bp/main.html | 70 ++++++++++ 6 files changed, 234 insertions(+) create mode 100644 benchmarks/repeat-animate-bp/app-classfilter.js create mode 100644 benchmarks/repeat-animate-bp/app-noanimate.js create mode 100644 benchmarks/repeat-animate-bp/app.js create mode 100644 benchmarks/repeat-animate-bp/bp.conf.js create mode 100644 benchmarks/repeat-animate-bp/common.js create mode 100644 benchmarks/repeat-animate-bp/main.html diff --git a/benchmarks/repeat-animate-bp/app-classfilter.js b/benchmarks/repeat-animate-bp/app-classfilter.js new file mode 100644 index 000000000000..6c2708da145f --- /dev/null +++ b/benchmarks/repeat-animate-bp/app-classfilter.js @@ -0,0 +1,9 @@ +'use strict'; + +angular.module('repeatAnimateBenchmark', ['ngAnimate']) + .config(function($animateProvider) { + $animateProvider.classNameFilter(/animate-/); + }) + .run(function($rootScope) { + $rootScope.fileType = 'classfilter'; + }); diff --git a/benchmarks/repeat-animate-bp/app-noanimate.js b/benchmarks/repeat-animate-bp/app-noanimate.js new file mode 100644 index 000000000000..cc99bfcc8cd7 --- /dev/null +++ b/benchmarks/repeat-animate-bp/app-noanimate.js @@ -0,0 +1,6 @@ +'use strict'; + +angular.module('repeatAnimateBenchmark', []) + .run(function($rootScope) { + $rootScope.fileType = 'noanimate'; + }); diff --git a/benchmarks/repeat-animate-bp/app.js b/benchmarks/repeat-animate-bp/app.js new file mode 100644 index 000000000000..e7ac91d7c5fd --- /dev/null +++ b/benchmarks/repeat-animate-bp/app.js @@ -0,0 +1,7 @@ +'use strict'; + +angular.module('repeatAnimateBenchmark', ['ngAnimate']) + .run(function($rootScope) { + $rootScope.fileType = 'default'; + }); + diff --git a/benchmarks/repeat-animate-bp/bp.conf.js b/benchmarks/repeat-animate-bp/bp.conf.js new file mode 100644 index 000000000000..5bba15017c10 --- /dev/null +++ b/benchmarks/repeat-animate-bp/bp.conf.js @@ -0,0 +1,20 @@ +module.exports = function(config) { + config.set({ + scripts: [ + { + id: 'angular', + src: '/build/angular.js' + }, + { + id: 'angular-animate', + src: '/build/angular-animate.js' + }, + { + id: 'app', + src: 'app.js', + }, + { + src: 'common.js' + }] + }); +}; diff --git a/benchmarks/repeat-animate-bp/common.js b/benchmarks/repeat-animate-bp/common.js new file mode 100644 index 000000000000..18934d438df8 --- /dev/null +++ b/benchmarks/repeat-animate-bp/common.js @@ -0,0 +1,122 @@ +'use strict'; + +(function() { + var app = angular.module('repeatAnimateBenchmark'); + + var animateProvider; + + app.config(function($compileProvider, $animateProvider) { + if ($compileProvider.debugInfoEnabled) { + $compileProvider.debugInfoEnabled(false); + } + + }); + + app.run(function($animate) { + if ($animate.enabled) { + $animate.enabled(true); + } + }); + + app.controller('DataController', function($scope, $rootScope, $animate) { + var totalRows = 500; + var totalColumns = 20; + + var data = $scope.data = []; + + function fillData() { + if ($animate.enabled) { + $animate.enabled($scope.benchmarkType === 'globallyDisabled' ? false : true); + } + + for (var i=0; i +
+
+

+ Tests rendering of an ngRepeat with 1000 elements.
+ Animations can be enabled / disabled in different ways.
+ Two tests require reloading the app with different module / app configurations. +

+ +
+
+
(requires app.js)
+
(requires app.js or app-classfilter.js)
+
(requires app.js)
+
(requires app-noanimate.js)
+
(requires app-classfilter.js)
+ + + + +
+
+
+ + {{column.i}} + +
+
+
+
+
+
+ + {{column.i}} + +
+
+
+
+
+
+ + {{column.i}} + +
+
+
+
+
+
+ + {{column.i}} + +
+
+
+
+
+
+ + {{column.i}} + +
+
+
+
+ +
+
+