foundation icon indicating copy to clipboard operation
foundation copied to clipboard

Use weigh

Open ndmitchell opened this issue 8 years ago • 3 comments

It was recently observed that foundation is faster than text/bytestring even though it allocates a lot more: https://github.com/ndmitchell/weeder/pull/27

I suspect if you allocated less you'd we way faster. You might want to use https://hackage.haskell.org/package/weigh to benchmark your allocations, as that would then let you measure and confirm progress, and prevent regressions

Given this project, I suspect this will cause you to reinvent the package first...

ndmitchell avatar Oct 19 '17 20:10 ndmitchell

heh, I like weigh (and I have used it in the past) ;p

vincenthz avatar Oct 19 '17 21:10 vincenthz

Also while it's globally true that less allocation is better, it doesn't necessary translate all the time in less cpu time. Of course thought, I'm pretty sure we can do better on the two different metrics...

vincenthz avatar Oct 19 '17 21:10 vincenthz

Yep, I think reducing allocation for allocations sake is pointless - but I find it almost always does translate to less CPU time if you keep everything else constant (fewer GC runs at minimum).

ndmitchell avatar Oct 19 '17 22:10 ndmitchell