unshift! adds an element at the front of a
Vector, which requires shifting the whole contents of the
Vector to the right. This feels like is should be slow (or, rather, slooow).
However, some naive benchmarking indicates otherwise:
using BenchmarkTools julia 0.6> @btime push!(v, 1) samples=1000 evals=1000; 25.801 ns (0 allocations: 0 bytes) julia 0.6> @btime unshift!(v, 1) samples=1000 evals=1000; 26.104 ns (0 allocations: 0 bytes)
unshift! actually as fast as this would indicate?