logoalt Hacker News

bheadmaster • 01/21/2025 • 1 reply • view on HN

Thank you for your helpful input.


Replies

orf • 01/21/2025

No worries, this help also generalises to any time you want to add locking/synchronisation or other overheads to a hot code path.

It’s best not to acquire a mutex and launch a goroutine to read 3 bytes of data at a time.

Also, hot tip: you can like… benchmark this. It’s not illegal.

➕ show 1 reply