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
Test case to see how indexOf in conjunction with toLowerCase will perform against a Regular Expression test.
<textarea id="test">
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"><head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="HandheldFriendly" content="true" />
<link rel="alternate" media="handheld" href="" />
<style type="text/css">
body {font-size:small;font-family:Arial, Helvetica, sans-serif;}
h1 {font-size:large;color:#1d46a6;margin-bottom:0.4em;}
p {margin-top:0.4em;margin-bottom:0.4em}
.center {text-align:center;}
.nobr {white-space: nowrap}
</style>
<style type="text/css">
h2 {font-size:small;color:#316ba6;font-weight:bold;padding-top:10px;}
.new {font-size:small;color:#ee0055;font-weight:bold;padding-top:10px;margin-bottom:0.8em;}
.product-icon {vertical-align:bottom;}
.promoheading {font-size:small;color:#316ba6;font-weight:bold;padding-top:10px;margin-bottom:0.8em;}
</style>
<title>Google Mobile</title></head>
<body id="ProductsPage"><img src="http://ad.doubleclick.net/activity;src=2542116;type=mobil635;cat=mobil356;ord=326156444?" width="1" height="1" alt="" />
<div id="container"><p>
Looking for Search? Visit <a href="http://www.google.com/m?source=backstop&session=6973391152&dc=gorganic">Google.com</a>.</p>
<img src="http://www.gstatic.com/mgc/images/google_logo_small.gif" width="110" height="33" alt="Google Mobile" />
<h2>Google mobile products</h2>
<img src="http://www.gstatic.com/mgc/images/icons/16x16/search.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="search" href="http://www.google.com/m?source=mobileproducts&dc=gorganic">Search</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/gmail.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="pudu" href="http://m.google.com/mail?session=6973391152&dc=gorganic">Gmail</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/maps.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="gmm_local" href="http://m.google.com/maps?session=6973391152&dc=gorganic">Maps</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/buzz.png" width="16" height="16" alt="" /> <a class="productLink productName" id="buzz" href="https://m.google.com/app/buzz">Buzz</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/news.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="news" href="http://m.google.com/news?session=6973391152&dc=gorganic">News</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/igoogle.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="igoogle" href="http://www.google.com/m/ig?source=products&dc=gorganic">iGoogle</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/sync.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="sync_config" href="https://m.google.com/sync/settings/?source=mobileproducts">Sync</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/picasa.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="photos" href="http://m.google.com/photos?session=6973391152&dc=gorganic">Photos</a>
<br /> <img src="http://m.google.com/images/icons/16x16/voice.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="voice_webapp" href="http://www.google.com/voice/m?dc=gorganic">Voice</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/calendar.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="calendar" href="http://m.google.com/calendar?session=6973391152&dc=gorganic">Calendar</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/reader.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="reader" href="http://m.google.com/reader?session=6973391152&dc=gorganic">Reader</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/sms.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="sms" href="http://m.google.com/sms?session=6973391152&dc=gorganic">SMS</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/orkut.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="orkut" href="http://m.google.com/orkut?session=6973391152&dc=gorganic">Orkut</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/docs.png" width="16" height="16" alt="" /> <a class="productLink productName" id="docs" href="http://m.google.com/docs?session=6973391152&dc=gorganic">Docs</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/notebook.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="notebook" href="http://m.google.com/notebook?session=6973391152&dc=gorganic">Notebook</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/blogger.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="blogger" href="http://m.google.com/blogger?session=6973391152&dc=gorganic">Blogger</a>
<br /> <img src="http://www.gstatic.com/mgc/images/icons/16x16/tasks.gif" width="16" height="16" alt="" /> <a class="productLink productName" id="tasks" href="http://m.google.com/tasks?session=6973391152&dc=gorganic">Tasks</a>
<br />
<br />
*Tip: Bookmark this page for quick access to Google services.
<br />
<a id="changeCountry" href="http://m.google.com/countries/?session=6973391152&dc=gorganic">Not in United States?</a>
<br />
<br />
<a id="help" href="http://m.google.com/m/help/?session=6973391152&dc=gorganic">Help</a>
<br />
<div><div style="padding-top:0.5em"><img src="http://www.gstatic.com/mgc/images/icons/change_language.gif" width="32" height="16" style="vertical-align:top;" alt="" /><a id="changeLanguage" href="http://m.google.com/languages/?session=6973391152&dc=gorganic&continue=http://m.google.com/?session%3D6973391152" style="vertical-align:top; margin-top:1em">Change Language</a></div><p style="text-align: center;">©2011 - <span class="nobr"><a href="http://m.google.com/m/terms?session=6973391152&dc=gorganic">Terms of Service</a></span> - <span class="nobr"><a href="http://m.google.com/privacy?session=6973391152&dc=gorganic">Privacy Policy</a></span></p></div></div></body></html>
</textarea>
<script>
var obj = document.getElementById('test');
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
toLowerCase indexOf |
| ready |
RegExp test |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.