6 ms·
If string processing is a bottleneck in your system, either your system isn't doing anything else interesting to take up CPU time, or you've done something very
by carbonica 15y ago
If string processing is a bottleneck in your system, either your system isn't doing anything else interesting to take up CPU time, or you've done something very, very wrong. Serialization is a damn-near solved problem.
- silentbicycle 15y agoNewcomers to Erlang tend to do string handling with a heavy Ruby/Java/whatever accent. That's the problem. The default Erlang string type is a linked list of ints (which can be pattern-matched on), but atoms (AKA "symbols" is Lisp, Ruby, etc.) and binaries (arrays of raw binary data) address situations that need more specific trade-offs. In particular, redundant string concatenation and flattening tends to be CPU hog, but IO-Lists automatically flatten all string types during transmission and have already been thoroughly optimized. Of course, if you ignore the serialization solutions Erlang provides, there is a performance hit.
- EponymousCoward 15y agoIt's a web server that hands off to a queue. What do you think it's doing besides serialization?