4 ms·
Interesting but his scalar code is slow. When you care about performance, better to implement such algorithm so it reads bytes one by one, but move blocks with
by Const-me 8y ago
Interesting but his scalar code is slow. When you care about performance, better to implement such algorithm so it reads bytes one by one, but move blocks with memmove when switching from write to skip state.
Pathological case (skipping every other character) is slightly slower, but on real data it’s much faster overall.
Unfortunately I don’t have AVX512 hardware so I can’t test.
- wmu 8y agoI was wondering if you like to contribute better scalar code? I'll be happy to include your (or anybody else) code and then compare different approaches.
- aqrit 8y agoTry some of these :p https://gist.github.com/aqrit/6e73ca6ff52f72a2b121d584745f89f3 https://gist.github.com/aqrit/6e73ca6ff52f72a2b121d584745f89...
- wmu 8y agoThank you! :)
- wmu 8y agoThank you again! Take a look: https://github.com/WojciechMula/toys/tree/master/avx512-remove-spaces https://github.com/WojciechMula/toys/tree/master/avx512-remo... Your AVX2 is better in benchmarks than Zach's AVX512VBMI, wow. I have to admit that looked at the code but got lost. :) Will need more time to digest it. However, in despacing English texts and CSV, Zach's variant is still faster.