Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Mac OS X 10.15.7
Desktop
2 years ago
length array of strings
14.6M/s
length empty array
14.5M/s
length filled string
12.3M/s
length empty string
10.3M/s
length empty array of objects
9.9M/s
isEmpty empty string
6.7M/s
isEmpty filled string
6.6M/s
isEmpty array of strings
6.4M/s
isEmpty empty array
6.4M/s
custom isEmpty empty string
5.1M/s
isEmpty array of objects
5.0M/s
custom isEmpty filled string
4.9M/s
custom isEmpty empty array
4.7M/s
custom isEmpty array of strings
3.9M/s
custom isEmpty array of objects
3.0M/s
View exact numbers
| Test name |
Executions per second |
|
✓
length array of strings
|
14,567,482 Ops/sec |
|
length empty array
|
14,495,107 Ops/sec |
|
length filled string
|
12,300,209 Ops/sec |
|
length empty string
|
10,294,567 Ops/sec |
|
length empty array of objects
|
9,877,771 Ops/sec |
|
isEmpty empty string
|
6,725,451 Ops/sec |
|
isEmpty filled string
|
6,575,069 Ops/sec |
|
isEmpty array of strings
|
6,369,231 Ops/sec |
|
isEmpty empty array
|
6,354,874 Ops/sec |
|
custom isEmpty empty string
|
5,055,660 Ops/sec |
|
isEmpty array of objects
|
5,012,964 Ops/sec |
|
custom isEmpty filled string
|
4,943,220 Ops/sec |
|
custom isEmpty empty array
|
4,729,560 Ops/sec |
|
custom isEmpty array of strings
|
3,882,635 Ops/sec |
|
custom isEmpty array of objects
|
2,957,262 Ops/sec |
Tests:
-
isEmpty empty array
-
length empty array
-
custom isEmpty empty array
-
isEmpty array of strings
-
length array of strings
-
custom isEmpty array of strings
-
isEmpty array of objects
-
length empty array of objects
-
custom isEmpty array of objects
-
isEmpty empty string
-
length empty string
-
custom isEmpty empty string
-
isEmpty filled string
-
length filled string
-
custom isEmpty filled string