open-goal / jak-project

Reviving the language that brought us the Jak & Daxter Series
https://opengoal.dev
ISC License
2.8k stars 170 forks source link

[goalc] speed up jak3 compilation #3454

Closed water111 closed 5 months ago

water111 commented 5 months ago

I noticed that jak 3's compilation was spending a lot of time accessing the unordered_maps we use to store constants and symbol types.

I repurposed the EnvironmentMap originally made for GOOS for this. It turns out that we were copying the entire constant map whenever we encountered a deftype, and fixed that too.

This speeds up jak3 compiles from ~16 to 11 seconds for me.