6 ms·
That's great. It's been rare for me too, but I'm currently trying to solve an issue where it seems like we've inadvertently built up some kind of mega thunk tha
by voidhorse 5y ago
That's great. It's been rare for me too, but I'm currently trying to solve an issue where it seems like we've inadvertently built up some kind of mega thunk that's making performance absolutely horrible for large inputs. The hotspot in question currently implemented as big recursive loop, so it's proving hard to untangle. Normally shortcut fusion and laziness make it a non-issue but it seems like we hit a thunk chain here or something.
- whateveracct 5y agoHave you tried the various profiling modes to hint at where it is? Other than that, wolf-fencing it down is a good way to go usually.
- User23 5y agoA monad is just a monoid in the category of endofunctors, what's the problem?
- whateveracct 5y agohaha funny but my comment consisted of 1) straight-up language tooling (profiling that breaks down heap usage in various ways) 2) wolf-fencing, which has nothing to do with haskell
- User23 5y agoIt’s too bad that the humorless are downvoting us both. In any event wolf-fencing very much appears to be Haskell specific based on some web searching. Or perhaps it’s a home improvement product? Several search results appear to indicate that[1]. [1] https://www.wolfhomeproducts.com/wolfrailing https://www.wolfhomeproducts.com/wolfrailing
- whateveracct 5y agoIt's apparently not very SEO'd. But it's a debugging technique. http://coreygoldberg.blogspot.com/2008/12/wolf-fence-debugging.html http://coreygoldberg.blogspot.com/2008/12/wolf-fence-debuggi... It's universally applicable. I've done it in C, Scala, Go, Java, Haskell..everything. Perf-debugging wise - you basically remove parts of your computation and perform binary search to hone in on the parts that are on the critical path. I agree that a lot of Haskellers come off as "what's the problem?" (including myself). But Haskell is a small, niche, weird language. You kinda need that attitude to dive deep into it.
- ImprobableTruth 5y agoWolf fencing = Using the bisection method/binary search to find errors. Essentially what people intuitively do.
- ParetoOptimal 5y agoI think people intuitively start with bisection and binary search but quickly lapse into magical thinking rather than adhering to the process.
- josephcsible 5y agoHow can wolf-fencing be Haskell-specific when it's 8 years older than Haskell is? https://doi.org/10.1145/358690.358695 https://doi.org/10.1145/358690.358695
- Smaug123 5y agoI claim that "wolf-fencing" appears to be Haskell-specific for the same reason that "monad" does a good job of appearing to be Haskell-specific. It's because the Haskell community is uniquely very ready to adopt terms which are widely used in mathematics. (It's "lion hunting" in maths, but obviously from the same root.)
- tome 5y agoIf it's open source please post a link. I'll take a look.