Someone already set up a jsperf test for this an hour or so ago, so I added my regex solution. http://jsperf.com/spacify/2
On my machine, I was surprised to see that the for loop is the fastest (Chrome + Crunchbang).
I'd guess that this is probably because looping structures are heavily optimized in modern JS engines.