Also, don’t time in global scope. Do
foo(v) = codeunit_check_length.(v, 8)
@time foo(svec1)
if not @btime foo($svec1)
.
Also, note that you are timing memory allocation of the output vector etcetera. I’m not clear on how exactly you are deciding how fast you need this to be.