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
<a href="http://ya.ru/">Я ру</a>
<a href="http://google.ru/">Гугл</a>
<a href="http://habrahabr.ru/">Хабр</a>
<a href="http://twitter.com/">twitter.com</a>
<script type="application/javascript;version=1.7">
var aDomainContentGeneratorWithSameContentAndDomain = function (aList) {
for (var i = 0, c = aList.length, a, content, domain; i < c; i++) {
a = aList[i];
content = a.innerHTML;
domain = a.getAttribute('href').replace('http://', '').split('/').shift();
if (content === domain) {
yield {domain: domain, content: content};
}
}
};
var aDomainContentGenerator = function (aList) {
for (var i = 0, c = aList.length, a, content, domain; i < c; i++) {
a = aList[i];
content = a.innerHTML;
domain = a.getAttribute('href').replace('http://', '').split('/').shift();
yield {domain: domain, content: content};
}
};
</script>
<script>
var aList = document.querySelectorAll('a'), devNull;
var aDomainContentWithSameContentAndDomainFunction = function (aList) {
for (var i = 0, c = aList.length, a, content, domain; i < c; i++) {
a = aList[i];
content = a.innerHTML;
domain = a.getAttribute('href').replace('http://', '').split('/').shift();
if (content === domain) {
devNull = domain;
}
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
loop |
| ready |
generator |
| ready |
generator with generator expression |
| ready |
loop function |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.