array join vs string connect
JavaScript performance comparison
Info
Added a test
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script>
var alphabet = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z";
var alphatmp = [];
for (i = 0; i < 200; i++)
alphatmp.push(alphabet);
var str_to_split = alphatmp.join(',');
var myarray = str_to_split.split(',');
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
array join |
|
pending… |
string connect |
|
pending… |
while |
|
pending… |
jquery |
|
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 AlienWebguy
- Revision 2: published
- Revision 3: published
- Revision 4: published
- Revision 5: published
- Revision 7: published by Kevin
- Revision 11: published
- Revision 12: published
- Revision 17: published
- Revision 18: published
- Revision 19: published
- Revision 20: published
- Revision 21: published
- Revision 22: published
- Revision 23: published by array join vs string connect
- Revision 24: published
- Revision 25: published by pld
- Revision 27: published
- Revision 28: published
- Revision 31: published by pcthomatos
- Revision 32: published
- Revision 33: published by hyunsook
- Revision 34: published by Thomas Lindstrøm
0 comments