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
<script>
var allowedArr = ["A", "ABBR", "ACRONYM", "ADDRESS", "APPLET", "AREA", "ARTICLE", "ASIDE", "AUDIO", "B", "BASE", "BASEFONT", "BDO", "BGSOUND", "BIG", "BLOCKQUOTE", "BODY", "BR", "BUTTON", "CANVAS", "CAPTION", "CENTER", "CITE", "CODE", "COL", "COLGROUP", "COMMENT", "CUSTOM", "DD", "DEL", "DFN", "DIR", "DIV", "DL", "DT", "EM", "EMBED", "FIELDSET", "FIGCAPTION", "FIGURE", "FONT", "FOOTER", "FORM", "FRAME", "FRAMESET", "HEAD", "HEADER", "HGROUP", "HN", "HR", "HTML", "I", "IFRAME", "IMG", "INPUT", "INS", "ISINDEX", "KBD", "LABEL", "LEGEND", "LI", "LINK", "LISTING", "MAP", "MARK", "MARQUEE", "MEDIA", "MENU", "META", "NAV", "NOBR", "NOFRAMES", "NOSCRIPT", "OBJECT", "OL", "OPTGROUP", "OPTION", "P", "PARAM", "PLAINTEXT", "PRE", "Q", "RT", "RUBY", "S", "SAMP", "SCRIPT", "SECTION", "SELECT", "SMALL", "SOURCE", "SPAN", "STRIKE", "STRONG", "STYLE", "SUB", "SUP", "TABLE", "TBODY", "TD", "TEXTAREA", "TFOOT", "TH", "THEAD", "TITLE", "TR", "TT", "U", "UL", "VAR", "VIDEO", "WBR", "XML", "XMP"];
var allowedObj = {A:1,ABBR:1,ACRONYM:1,ADDRESS:1,APPLET:1,AREA:1,ARTICLE:1,ASIDE:1,AUDIO:1,B:1,BASE:1,BASEFONT:1,BDO:1,BGSOUND:1,BIG:1,BLOCKQUOTE:1,BODY:1,BR:1,BUTTON:1,CANVAS:1,CAPTION:1,CENTER:1,CITE:1,CODE:1,COL:1,COLGROUP:1,COMMENT:1,CUSTOM:1,DD:1,DEL:1,DFN:1,DIR:1,DIV:1,DL:1,DT:1,EM:1,EMBED:1,FIELDSET:1,FIGCAPTION:1,FIGURE:1,FONT:1,FOOTER:1,FORM:1,FRAME:1,FRAMESET:1,HEAD:1,HEADER:1,HGROUP:1,HN:1,HR:1,HTML:1,I:1,IFRAME:1,IMG:1,INPUT:1,INS:1,ISINDEX:1,KBD:1,LABEL:1,LEGEND:1,LI:1,LINK:1,LISTING:1,MAP:1,MARK:1,MARQUEE:1,MEDIA:1,MENU:1,META:1,NAV:1,NOBR:1,NOFRAMES:1,NOSCRIPT:1,OBJECT:1,OL:1,OPTGROUP:1,OPTION:1,P:1,PARAM:1,PLAINTEXT:1,PRE:1,Q:1,RT:1,RUBY:1,S:1,SAMP:1,SCRIPT:1,SECTION:1,SELECT:1,SMALL:1,SOURCE:1,SPAN:1,STRIKE:1,STRONG:1,STYLE:1,SUB:1,SUP:1,TABLE:1,TBODY:1,TD:1,TEXTAREA:1,TFOOT:1,TH:1,THEAD:1,TITLE:1,TR:1,TT:1,U:1,UL:1,VAR:1,VIDEO:1,WBR:1,XML:1,XMP:1};
var allowedReg = /^(?:A|ABBR|ACRONYM|ADDRESS|APPLET|AREA|ARTICLE|ASIDE|AUDIO|B|BASE|BASEFONT|BDO|BGSOUND|BIG|BLOCKQUOTE|BODY|BR|BUTTON|CANVAS|CAPTION|CENTER|CITE|CODE|COL|COLGROUP|COMMENT|CUSTOM|DD|DEL|DFN|DIR|DIV|DL|DT|EM|EMBED|FIELDSET|FIGCAPTION|FIGURE|FONT|FOOTER|FORM|FRAME|FRAMESET|HEAD|HEADER|HGROUP|HN|HR|HTML|I|IFRAME|IMG|INPUT|INS|ISINDEX|KBD|LABEL|LEGEND|LI|LINK|LISTING|MAP|MARK|MARQUEE|MEDIA|MENU|META|NAV|NOBR|NOFRAMES|NOSCRIPT|OBJECT|OL|OPTGROUP|OPTION|P|PARAM|PLAINTEXT|PRE|Q|RT|RUBY|S|SAMP|SCRIPT|SECTION|SELECT|SMALL|SOURCE|SPAN|STRIKE|STRONG|STYLE|SUB|SUP|TABLE|TBODY|TD|TEXTAREA|TFOOT|TH|THEAD|TITLE|TR|TT|U|UL|VAR|VIDEO|WBR|XML|XMP)$/i;
var allowedString = ' ' + allowedArr.join(' ') + ' ';
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Using Array with .indexOf |
| ready |
Using Object with in operator |
| ready |
Using Object with hasOwnProperty |
| ready |
Using a regular expression |
| ready |
Object with truthy values |
| ready |
Using String with .indexOf |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.