← Back to context

Comment by amelius

5 hours 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.

I 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.

Many 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.

Wow 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?

  • Yeah 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.

You 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.

I 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.