Carp
Carp copied to clipboard
Profiling the compiler
So far very little work has gone into making the compiler fast. For the most parts I thinks it's "fast enough", but since there presumably are no big projects written in Carp this is hard to know for sure. I think that profiling the compiler to at least know what parts are slow could be an interesting and worthwhile endeavour. This issue can be a good place for reporting the results and discussing possible improvements.
A good example for the compiler being mysteriously slow (at least on my machine) is tests/map.carp
. That test takes almost 20 seconds to compile.
#795 attaches a flamegraph for that same file. Looks like toC
and multiLookupInternal
are good candidates.
Also, flamegraph.sh
shows that carp takes almost the same time as clang.
When I rewrote the env code recently, the biggest hotspots were in exhaustive env lookups (looking for some binder in all parents, used modules, etc.) and emit.hs. This likely hasn't changed. After we do a bit more general clean up and push some fixes for outstanding bugs we can try and tackle this.