http://jsperf.com/
This site test javascript performances.
About test example
triple-equals-vs-double-equals
Page like this.
If you click 'Run tests'
processing and return result to you.
like this.
Testing in Chrome 48.0.2564.97 32-bit on Windows NT 6.3 64-bit
Test | Ops/sec |
===
| if (s1 === s2) {}
if (s1 === s3) {}
if (s1 === s4) {}
if (s1 === s5) {}
| 126,211,632±1.51%89% slower |
==
| if (s1 == s2) {}
if (s1 == s3) {}
if (s1 == s4) {}
if (s1 == s5) {}
| 10,709,041±5.01%99% slower |
!==
| if (s1 !== s2) {}
if (s1 !== s3) {}
if (s1 !== s4) {}
if (s1 !== s5) {}
| 70,270,530±0.00%fastest |
!=
| if (s1 != s2) {}
if (s1 != s3) {}
if (s1 != s4) {}
if (s1 != s5) {}
| 5,273,440±0.00%fastest |
=== on same type only
| if (s1 === s3) {}
if (s1 === s5) {}
if (s1 === s3) {}
if (s1 === s5) {}
| 739,712,962±0.00%fastest |
== on same type only
| if (s1 == s3) {}
if (s1 == s5) {}
if (s1 == s3) {}
if (s1 == s5) {}
| 565,679,421±0.00%fastest |
!== on same type only
| if (s1 !== s3) {}
if (s1 !== s5) {}
if (s1 !== s3) {}
if (s1 !== s5) {}
| 706,719,526±0.00%fastest |
!= on same type only
| if (s1 != s3) {}
if (s1 != s5) {}
if (s1 != s3) {}
if (s1 != s5) {}
| 1,133,703,804±0.00%fastest |
댓글 없음:
댓글 쓰기