Compile times
martin-t opened this issue · comments
Martin Taibr commented
Switch to a hashmap or trie for storing the strings, the generated match is huge:
cargo llvm-lines
:
Lines Copies Function name
----- ------ -------------
119771 (100%) 4182 (100%) (TOTAL)
30067 (25.1%) 1 (0.0%) rec_wars::cvars::Cvars::set_str
5892 (4.9%) 1 (0.0%) rec_wars::cvars::Cvars::get_string
3083 (2.6%) 1 (0.0%) rec_wars::rendering::render_viewport
and render_viewport is a huge 700 line function.
Maybe llvm lines are not the best metric but it absolutely does add a lot to compile times (test with SetGetDummy)
Martin Taibr commented
Martin Taibr commented
Made some improvements, rebuild times are acceptable up to 1k cvars.
Waiting for offset_of to to stabilized so we can reasonably support up to 10k cvars.