Can you write a benchmark page, that makes 12.500 classes, plain DOM of 10.000 elements with random classes, makes 1.000.000 addClass operations, 700.000 removeClass operations, 1.500.000 containClass operations?
The result is small table:
operation name
amount of operations
total time spent
average
median
addClass
1.000.000
?
?
?
Details:
operation target is random
DOM generated by script
removeClass operation take one of target classes
operations sequence is random, but distribution proportional to all operations
function bench_wrapper(/* array */ result, func) {
return wrapper() {
var res, time;
time = new Date();
res = func.apply(this, arguments);
time = new Date - time; /* milliseconds */
result.push(time);
return res;
}
}
Can you write a benchmark page, that makes 12.500 classes, plain DOM of 10.000 elements with random classes, makes 1.000.000 addClass operations, 700.000 removeClass operations, 1.500.000 containClass operations?
The result is small table:
Details: