Let me share our experience with performance optimisation of our Elm app and looking for bottle necks. Usually is good to use browsers dev tools for performance profiling. At least we did it, but it’s not easier to follow compiled Elm code even if you do not have minified it.
So for our development purposes I made few simple regex which could help us to easier identify which function call is responsive for slowness.
To help give some context to this, the script by @janjelinek replaces a good chunk of your (anonymous) functions with a named variant. Particularly around F2,F3,… and A2,A3,… functions. So, the Chrome devtools (Performance tab) become more useful to Elm developers with this postprocessing step applied.
Actually I wonder if this wouldn’t be a useful thing for the Elm Compiler to emit when in dev mode by default. It’s fairly unlikely that we will get better profiling tools native to Elm anytime soon.
To have named anonymous functions natively in compiler would be cool, but I also don’t believe it happen anytime soon. That’s why I decided to come up with this simple solution. It’s not 100% bulletproof but it’s working on our huge Elm codebase without any issues so far. I believe It can be even improved to be able cover almost all anonymous functions but this was quick win without too much complexity.