[erlang-questions] Performance of the append/reverse idiom
Mon Jul 16 09:53:06 CEST 2007
Is reverse a bottleneck?
The are some *extremely* rare cases where people write code to handle
and non-reverse lists (I think the library routines for sort remember
if the current
list being sorted is in normal or reversed order) but this is only useful when
you're interested in making a tiny gain in efficiency (it also make the code
a mess to read).
The most common bottleneck are in the I/O system. Parsing inputs (in
is always a slow - other bottleneck are usually in the process
structure - using a centralized server that serializes everything can
make nasty bottlenecks.
On 7/16/07, Christopher Baus <> wrote:
> I'm still going through Joe's book, but as a C/C++ hack, I can't help
> but have some reservations about performance. One common idiom is to
> append to the front of a list and then reverse the list when the append
> is complete. I assume this a O(n) operation. Is it common for reverse
> to be a bottleneck in many applications?
> erlang-questions mailing list
More information about the erlang-questions