Re:Turn O(n^2) reverse into O(n)
by yongjik on Monday December 16, 2013 @01:59PM
(#6916981)
I wonder if there's something different about Haskell that makes "less copying" more attractive?
In the C++ world, libstdc++ strings have copy-on-write semantics, which (as far as I heard) turned out to be terrible because you have to do reference counting instead, and with multithreading it requires atomic operations, which is slower than copying for small strings.
In the C++ world, libstdc++ strings have copy-on-write semantics, which (as far as I heard) turned out to be terrible because you have to do reference counting instead, and with multithreading it requires atomic operations, which is slower than copying for small strings.