.exec vs .match vs .test
JavaScript performance comparison
Info
Test case to determine which code is fastest at detecting a pattern within a string.
Preparation code
<script>
var rxTest = /equator/,
url = "http://www.equator.com/";
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
.match() |
|
pending… |
.exec() |
|
pending… |
.test() |
|
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 by Kyle A. Matheny
- Revision 2: published by Kyle A. Matheny
- Revision 3: published
- Revision 5: published
- Revision 8: published
0 comments