GrammaticalFramework / gf-core

Grammatical Framework core: compiler, shell & runtimes
https://www.grammaticalframework.org
Other
131 stars 35 forks source link

Don't add automatic cost centres to Data.Binary.Get #140

Closed anka-213 closed 2 years ago

anka-213 commented 2 years ago

When profiling the GF compiler using ghcs profiler, the majority of time is assigned to Data.Binary.Get.>>=.\, which doesn't make much sense. I belive inserting cost centres into that function is preventing some optimization from happening.

This patch disables automatic cost centres in that specific module, which significantly improves the runtime for the profiled version of the program.

When you're not running gf with stack run --profile or corresponding flags, this patch does nothing.

anka-213 commented 2 years ago

Before this pull request, profiling can look like this Before

Afterwards it looks like this After

Much better! The actual work is a much larger portion of the profile now!