4 ms·
Is all this worth it when you may have only a few chars of whitespace at most? When I was looking at something related to this recently I noticed gcc doing a p
by secondcoming 4y ago
Is all this worth it when you may have only a few chars of whitespace at most?
When I was looking at something related to this recently I noticed gcc doing a pretty cool optimisation [0], where it converted the whitespace chars into a bitfield and leveraged the `bt` instruction. It seems quite sensitive to the char string though and falls back to worse code easily (e.g add "\f\v" to the string) but it's easy to manually write the code so that gcc always generates the same.
https://godbolt.org/z/Tzr8e7x6q https://godbolt.org/z/Tzr8e7x6q