spike: Test using SIMD to parse coordinates
Can be extended to parse rgba when we already have it in our vector. I think the swizzle (shuffle) part is costing most of the performance
Also a note on types: I tried to change my solution to u16 (I'm currently using u32), but it was 20% slower. That's why I'm using u32.
If I follow the docs, and use cargo bench -Zbuild-std --target x86_64-unknown-linux-gnu, the time usage goes down to 21.5ms, from 50ms.
Ahh you're right! Have read that and had it back of my mind, but totally missed that. Thx!
That kind of motivates me to continue on this and add the rgb parsing as well ^^
the following test fails:
assert_eq!(simd_parse_coord(b"1 2\n "), (1, 2, 3));
The problem is, that the spaces after the newline are not ignored, and lead to an invalid pattern
This is the reason why I use trailing_zeros to get the number of digits, as it stops at the first one, and ignores all the other clutter. This obviously only works on one number at a time.
Yep, I have noticed the failing tests as well. I already have an idea on how to solve this (with no performance penalty), but I did not continue any further until we solved the performance problem. The -Zbuild-std improved things quite a bit, so I might add the rgb parsing and than re-visit the performance.