forked from mootools/slick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bench_uidOf.html
121 lines (107 loc) · 2.49 KB
/
bench_uidOf.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<!-- Provide a title. This will be shown on the generated chart -->
<title>Demo Test Suite</title>
<script type="text/javascript" src="JSLitmus.js"></script>
<script type="text/javascript">
(function(){
var local = {
uidx:0,
uidOf: function(node){
return node._slickUID || (node._slickUID = this.uidx++);
}
}
JSLitmus.test('_slickUID', function(count) {
while (count--){
local.uidOf(document.createElement('div'));
}
});
})();
(function(){
var local = {
uidx:0,
uidOf: function(node){
return node._slickUID || (node._slickUID = [this.uidx++])[0];
}
}
JSLitmus.test('_slickUID Array', function(count) {
while (count--){
local.uidOf(document.createElement('div'));
}
});
})();
(function(){
var local = {
uidx:0,
uidOf: function(node){
return node.uniqueID || (node.uniqueID = this.uidx++);
}
}
JSLitmus.test('uniqueID', function(count) {
while (count--){
local.uidOf(document.createElement('div'));
}
});
})();
(function(){
var local = {
uidx:0,
uidOf: function(node){
return node.uniqueNumber || (node.uniqueNumber = this.uidx++);
}
}
JSLitmus.test('uniqueNumber', function(count) {
while (count--){
local.uidOf(document.createElement('div'));
}
});
})();
(function(){
var uidx = 0;
JSLitmus.test('no FN _slickUID', function(count) {
var node;
while (count--){
node = document.createElement('div');
node._slickUID || (node._slickUID = uidx++);
}
});
})();
(function(){
var uidx = 0;
JSLitmus.test('no FN _slickUID Array', function(count) {
var node;
while (count--){
node = document.createElement('div');
node._slickUID || (node._slickUID = [uidx++])[0];
}
});
})();
(function(){
var uidx = 0;
JSLitmus.test('no FN uniqueID', function(count) {
var node;
while (count--){
node = document.createElement('div');
node.uniqueID || (node.uniqueID = uidx++);
}
});
})();
(function(){
var uidx = 0;
JSLitmus.test('no FN uniqueNumber', function(count) {
var node;
while (count--){
node = document.createElement('div');
node.uniqueNumber || (node.uniqueNumber = uidx++);
}
});
})();
</script>
</head>
<body onload="JSLitmus.runAll(event);">
<div id="test_element" style="overflow:hidden; width: 1px; height:1px;"></div>
</body>
</html>