[erlang-questions] Performance of the append/reverse idiom
Mon Jul 16 21:18:38 CEST 2007
> The most common bottleneck are in the I/O system. Parsing inputs (in
> any language)
> is always a slow - other bottleneck are usually in the process
> structure - using a centralized server that serializes everything can
> make nasty bottlenecks.
Thanks for your reply. I agree with you, but I can see why developers
would pause when adding an additional O(n) operation to the end of a list
accumulate operation when this could be handled at insertion time in a
doubly linked list -- especially in CPU bound applications.
I think a reasonable solution for most apps would be to manipulate the
data in reversed order, unless reversing is required by an I/O operation.
More information about the erlang-questions