Closed adinapoli closed 8 years ago
@vincenthz I have actually realised the majority of the memory improvements are going to come from the patches for hs-pem
and hs-asn1
. Using deque
here doesn't add any substantial improvement (on the contrary, it seems to degrade performance, after I reran the profiling) and at the same time it won't build on older GHC, so I'm closing this!
Hey @vincenthz ,
see this and that for context.
I have obtained a small improvement it memory efficiency and time by using a deque instead of a plain list in
onContainer
. The main insight is that:Is basically equivalent to this:
Avoiding the first
reverse
is possible just by taking the last element of the deque withsnoc
, and this way we do not have to reverse the list back a second time asl2
is already in the correct order, as we have simply removed things from the head or the tail of the deque.What we have got here is certainly curing the symptoms but not the illness; we would probably need a better algorithm if we want to get any major performance boost.