join/concat
JavaScript performance comparison
Info
A simpler check for testing for concat vs join outside of a loop (not building a string in a loop, typical use case would be to use a var in the string).
Preparation code
<script>
var str = 'string';
var barr = ['this', ' is', ' a', str, ' to', ' test', ' if', ' there', ' is', ' any', ' difference', ' between', ' concat', ' and', ' join'];
var sarr = ['this', ' is', ' a', str];
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
concat |
|
pending… |
join |
|
pending… |
concat shorter |
|
pending… |
join shorter |
|
pending… |
concat in a loop |
|
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 Stoyan
- Revision 2: published by lifesinger
- Revision 3: published by lifesinger
- Revision 5: published by GregWa
- Revision 6: published by Vladimir Sitnikov
- Revision 16: published by galambalazs
- Revision 19: published by Tilo
- Revision 20: published
- Revision 21: published
- Revision 22: published by JasonC
- Revision 23: published
- Revision 24: published
- Revision 25: published by Milan Adamovsky
- Revision 26: published
- Revision 27: published by Chrisgl
- Revision 28: published by Lodewijk Andre de la Porte
- Revision 29: published by Lodewijk Andre de la Porte
- Revision 30: published
- Revision 31: published
- Revision 34: published by Troy Kruthoff
- Revision 35: published
- Revision 36: published
- Revision 37: published
- Revision 38: published
- Revision 39: published
- Revision 40: published
- Revision 41: published
- Revision 42: published by rvignacio
- Revision 43: published by Piet
- Revision 44: published
- Revision 45: published
- Revision 46: published
- Revision 48: published by ebryn
- Revision 49: published
- Revision 50: published
- Revision 52: published by nerdgore
- Revision 53: published
0 comments