Compare Regex to JS
JavaScript performance comparison
Preparation code
<script src="//documentcloud.github.com/underscore/underscore-min.js"></script>
<script>
Benchmark.prototype.setup = function() {
var tests = [
"abc",
"abcdefghijk",
"abdfkmnpstvxz",
"cxy",
"cdklstxy",
"bfrtw",
"a b c",
"acg jko pr",
"a z",
"v z",
"a b cdefg kl",
"uv xyz",
"ab de gh",
"x yz",
"abcdefghijklmnopqrstuvwxyz",
"abbc",
"abcb",
"a bcdjkrza",
"qwerty",
"zyxcba",
"abcdfe",
"ab c dfe",
"a z a",
"asdfg",
"asd f g",
"poqwoieruytjhfg"
];
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
regex |
|
pending… |
vanillaJS |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published
0 comments