travisstaloch / simdjzon

simdjson port to zig
103 stars 5 forks source link

simplify prev implementation #23

Closed Validark closed 7 months ago

Validark commented 8 months ago

Reduce lines of code :)

For posterity, I also wrote this version just in case our standard library function gets removed.

        @shuffle(u8, chunk, prev_chunk, std.simd.join(
            ~(std.simd.iota(i32, N) + @as(@Vector(N, i32), @splat(chunk_len - N))),
            std.simd.iota(i32, chunk_len - N),
        ));
travisstaloch commented 7 months ago

Thanks for the patch and for the fallback version. I'm going to merge this now. As with the other patch, will test locally soon checking for slowdowns.