join/split vs. replace
JavaScript performance comparison
Preparation code
<script>
var str = '';
for (i = 0; i < 1000; i++) {
str += "i:" + i + " ";
}
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
split and join |
|
pending… |
replace |
|
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 Inez
- Revision 3: published
- Revision 4: published
- Revision 5: published
1 comment
adsf