3 ms·
Decimal strings are for human consumption, I suppose. Not sure if the nanosecond timescale is relevant then (unless you send these numbers to billions of people
by amelius 5mo ago
Decimal strings are for human consumption, I suppose. Not sure if the nanosecond timescale is relevant then (unless you send these numbers to billions of people which is unlikely). Sounds like a pointless exercise, or maybe they should have picked a better example.
- pipe2devnull 5mo agoWow that’s a bit harsh. You can’t think of any examples where you may need to send a string to something but want to do it quickly?
- amelius 5mo agoYeah maybe a bit harsh. But the point is if you are looking for that kind of performance, I don't see why you wouldn't send binary data and then unpack it as needed.
- appreciatorBus 5mo agoIf you control both ends of the pipe, then sure. But for better or worse, large chunks of infrastructure expect to send or receive JSON.
- DarkUranium 5mo agoBecause maybe the choice of serialization format isn't under your control?
- analog31 5mo agoI can imagine a time in the near future when the conversion of integers to decimal strings becomes a limit to the rate at which AI can generate text that's not worth reading.
- teo_zero 5mo agoYou assume that human consumption means immediate human consumption. By this metric, there's no need for video encoders faster than the movie's own FPS, either.
- bee_rider 5mo agoI do sort of agree that, at some point, there arrives a question of “are we sure we need to convert the ints to strings?” But it also serves as a convenient excuse to write fast AVX-512 code (practice and show off tricks if nothing else), the objective is immediately obvious (no need for intense numerical proofs). I like it.
- whiatp 5mo agoMany large distributed systems are built around pushing data through web requests, and human readable request/response formats (JSON, XML) are the most popular, and require integer to string conversions for serialization.