Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Use weigh #422

Open
ndmitchell opened this issue Oct 19, 2017 · 3 comments
Open

Use weigh #422

ndmitchell opened this issue Oct 19, 2017 · 3 comments

Comments

@ndmitchell
Copy link
Contributor

It was recently observed that foundation is faster than text/bytestring even though it allocates a lot more: ndmitchell/weeder#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...

@vincenthz
Copy link
Member

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

@vincenthz
Copy link
Member

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...

@ndmitchell
Copy link
Contributor Author

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).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants