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
Comparison of BlackScript class initialization. Originally on jsperf.com/ex-nihilo See blog post here: https://jwilliamdunn.blogspot.com/2018/07/blackscript.html
const pageRecord = {
createNew(id, pgNum, svg) {
return {
id: id,
pageNumber: pgNum,
size: 0,
svg: svg,
img: '',
isImgLoading: false,
isImgLoaded: false,
isSvgLoading: false,
isSvgLoaded: false,
renderPlaceholder: true,
renderSvg: false,
renderImg: false,
inlineSvg: ''
}
}
};
class pageClass {
constructor ({
id,
pageNumber,
svg
}) {
this.id = id
this.pageNumber = pageNumber
this.svg = svg
this.size = 0
this.img = ''
this.isImgLoading = false
this.isImgLoaded = false
this.isSvgLoading = false
this.isSvgLoaded = false
this.renderPlaceholder = true
this.renderSvg = false
this.renderImg = false
this.inlineSvg = ''
}
}
function pageFunction(id, pageNumber, svg) {
this.id = id
this.pageNumber = pageNumber
this.svg = svg
this.size = 0
this.img = ''
this.isImgLoading = false
this.isImgLoaded = false
this.isSvgLoading = false
this.isSvgLoaded = false
this.renderPlaceholder = true
this.renderSvg = false
this.renderImg = false
this.inlineSvg = ''
} Ready to run.
| Test | Ops/sec | |
|---|---|---|
| OldClassStyle | | ready |
| NewStyleClass | | ready |
| ExNihilo | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.