←back to thread

118 points vortex_ape | 1 comments | | HN request time: 0.201s | source
Show context
Dwedit ◴[] No.42743566[source]
Wouldn't branchless UTF-8 encoding always write 3 bytes to RAM for every character (possibly to the same address)?
replies(2): >>42743614 #>>42745222 #
1. ack_complete ◴[] No.42745222[source]
CPUs are surprisingly good at dealing with this in their store queues. I see this write-all-and-increment-some technique used a lot in optimized code, like branchless left-pack routines or overcopying in the copy handler of an LZ/Deflate decompressor.