This is true outside the browser too! At some point we found ~10% of all Ghostty IO time in an Asciinema dump was log warns for purposely unsupported sequences. We moved that to "log once per sequence" helper and saw that overhead disappear. Source here:
Did you know that even a simple console.log() per request can hugely hurt performance?
The built-in logger in the next h3/srvx release batches writes and caches the timestamp (Intl), cutting logging overhead ~60–85%.