I think push!() is faster because the other option is accessing an array that contains `#undef` values (Julia speak for a NULL pointer) and this is slower than accessing a regular array that does not contain #undef.
See: http://docs.julialang.org/en/latest/manual/faq/#nothingness-and-missing-values I would guess that you should rather worry about the overhead of boxing and garbage collecting the elements of the array. The Array{Any} only stores pointer, but the boxed values they point to is much bigger. For performance you should probably consider using a concrete array that stores values instead of pointers to values (not abstract element type). Ivar kl. 14:28:43 UTC+2 onsdag 4. juni 2014 skrev Magnus Lie Hetland følgende: > > I'm familiar with the module, and I don't think it's of much use here – > what I want is more basic (basically access to the underlying array > implementation, more or less, though I'd rather not use the C API directly > ;-) > > Functionality-wise, push! and resize! and plain one-dimensional arrays are > all need. The rest is just a question of performance. >
