3 ms·
The problem should be equivalent to: https://www.reddit.com/r/simd/comments/1hmwukl/mask_calculation_for_single_line_comments/ https://www.reddit.com/r/simd/com
by camel-cdr 10mo ago
The problem should be equivalent to: https://www.reddit.com/r/simd/comments/1hmwukl/mask_calculation_for_single_line_comments/ https://www.reddit.com/r/simd/comments/1hmwukl/mask_calculat...
Falvyu's and bremac's solution seems to be the best.
- zokrezyl 10mo agothanks for pointing out! I tried the borrowing trick from the previous segment, was pretty obvious, but for some reason failed as could not avoid at least one conditinonal... will try again.
- zokrezyl 10mo agoFor my problem describe under the link above the suggestions above eliminate indeed the branches, but same time the extra instructions slow down the same as my initial branches. Meaning, detecting newlines would work almost 100% of memory throughput, but detecting first non-space reduces the speed to bit above 50% of bandwith https://gist.github.com/zokrezyl/8574bf5d40a6efae28c9569a8d692a61 https://gist.github.com/zokrezyl/8574bf5d40a6efae28c9569a8d6...