I guess one should expect rather similar performance for 0.3.4 and 0.4.0-dev...
Function f3 (splice/insert method) performs very slightly worse on 0.4.0-dev+2551 - 10% slower compared to current 0.3.4 release. For me it means pretty much the same performance. Still one has to keep in mind it's still work in progress there and it can change with any nightly build :) Tomas On Wednesday, January 7, 2015 11:38:01 PM UTC+1, Greg Plowman wrote: > > I'm interested in something similar, so Thanks Tomas and Tim. > > Following on from Tomas original splice/insert method, and Tim's advice to > wrap in function: > > function f3(a, w) > local b = a[1:1+w] > for i in 2:length(a)-w > splice!(b, 1) > insert!(b, w+1, a[i+w]) > end > b > end > > Results on Julia v0.3.4: > > julia> @time f1(a,w); > elapsed time: 0.262851198 seconds (613990480 bytes allocated, 66.49% gc > time) > julia> @time f2(a,w); > elapsed time: 0.061057112 seconds (55163280 bytes allocated, 54.16% gc > time) > julia> @time f3(a,w); > elapsed time: 0.009859348 seconds (11840 bytes allocated) > > Interesting to know comparison of f3() on Julia v0.4? > > - Greg > >
