jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
This perf compares the performance of accessing a property on a plain object vs accessing one on a CSSStyleDeclaration.
var plain = { width: true }
var style = document.createElement('div').style
var existing = 'width'
var notExisting = 'nomnom'
Ready to run.
Test | Ops/sec | |
---|---|---|
existing in plain |
| ready |
existing in style |
| ready |
notExisting in plain |
| ready |
notExisting in style |
| ready |
plain.hasOwnProperty(existing) |
| ready |
style.hasOwnProperty(existing) |
| ready |
plain.hasOwnProperty(notExisting) |
| ready |
style.hasOwnProperty(notExisting) |
| ready |
plain[existing] === undefined |
| ready |
style[existing] === undefined |
| ready |
plain[notExisting] === undefined |
| ready |
style[notExisting] === undefined |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.