-
Notifications
You must be signed in to change notification settings - Fork 0
/
function-objects.js
145 lines (132 loc) · 4.92 KB
/
function-objects.js
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
function text1() {
const str1 = "this1 is a lorem ipsum string";
const str2 = "this1 is not a lorem ipsum string";
const str3 = "this1 is not a lorem ipsum string2";
const str4 = "this1 is not a lorem ipsum string4";
const str5 = "this1 is not a lorem ipsum string5";
const str6 = "this1 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text2() {
const str1 = "this2 is a lorem ipsum string";
const str2 = "this2 is not a lorem ipsum string";
const str3 = "this2 is not a lorem ipsum string2";
const str4 = "this2 is not a lorem ipsum string4";
const str5 = "this2 is not a lorem ipsum string5";
const str6 = "this2 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text3() {
const str1 = "this3 is a lorem ipsum string";
const str2 = "this3 is not a lorem ipsum string";
const str3 = "this3 is not a lorem ipsum string2";
const str4 = "this3 is not a lorem ipsum string4";
const str5 = "this3 is not a lorem ipsum string5";
const str6 = "this3 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text4() {
const str1 = "this4 is a lorem ipsum string";
const str2 = "this4 is not a lorem ipsum string";
const str3 = "this4 is not a lorem ipsum string2";
const str4 = "this4 is not a lorem ipsum string4";
const str5 = "this4 is not a lorem ipsum string5";
const str6 = "this4 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text5() {
const str1 = "this5 is a lorem ipsum string";
const str2 = "this5 is not a lorem ipsum string";
const str3 = "this5 is not a lorem ipsum string2";
const str4 = "this5 is not a lorem ipsum string4";
const str5 = "this5 is not a lorem ipsum string5";
const str6 = "this5 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text6() {
const str1 = "this6 is a lorem ipsum string";
const str2 = "this6 is not a lorem ipsum string";
const str3 = "this6 is not a lorem ipsum string2";
const str4 = "this6 is not a lorem ipsum string4";
const str5 = "this6 is not a lorem ipsum string5";
const str6 = "this6 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text7() {
const str1 = "this7 is a lorem ipsum string";
const str2 = "this7 is not a lorem ipsum string";
const str3 = "this7 is not a lorem ipsum string2";
const str4 = "this7 is not a lorem ipsum string4";
const str5 = "this7 is not a lorem ipsum string5";
const str6 = "this7 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text8() {
const str1 = "this8 is a lorem ipsum string";
const str2 = "this8 is not a lorem ipsum string";
const str3 = "this8 is not a lorem ipsum string2";
const str4 = "this8 is not a lorem ipsum string4";
const str5 = "this8 is not a lorem ipsum string5";
const str6 = "this8 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text9() {
const str1 = "this9 is a lorem ipsum string";
const str2 = "this9 is not a lorem ipsum string";
const str3 = "this9 is not a lorem ipsum string2";
const str4 = "this9 is not a lorem ipsum string4";
const str5 = "this9 is not a lorem ipsum string5";
const str6 = "this9 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
function text10() {
const str1 = "this10 is a lorem ipsum string";
const str2 = "this10 is not a lorem ipsum string";
const str3 = "this10 is not a lorem ipsum string2";
const str4 = "this10 is not a lorem ipsum string4";
const str5 = "this10 is not a lorem ipsum string5";
const str6 = "this10 is not a lorem ipsum string6";
return str1 + str2 + str3 + str4 + str5 + str6;
}
const jsObjs = [];
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text1();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text2();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text3();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text4();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text5();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text6();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text7();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text8();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text9();
jsObjs.push(jsObj);
}
for (let i = 0; i < 1_00_000; i++) {
const jsObj = new text10();
jsObjs.push(jsObj);
}
console.log("Objects created with function. Total function objects\t", jsObjs.length);