SuperTux / supertux

SuperTux source code
https://supertux.org
GNU General Public License v3.0
2.54k stars 492 forks source link

S-Expression: Minimize lag when parsing level names #3103

Open Vankata453 opened 5 days ago

Vankata453 commented 5 days ago

sexp::Parser now supports specifying a custom depth property for omitting (not parsing) structures deeper than depth in the tree, starting from 0. This optimizes parsing level names from level files a ton, since level files tend to be very big and used to take a while to parse collectively.

swagtoy commented 5 days ago

Unrelated, but i love you Vankata, thanks for delivering on my complaints! :-)

I recommend thorough testing on this of course, even in this codebase. Its good to ensure this can't be broken in any means.

Vankata453 commented 5 days ago

i think it works maybe? idk it doesnt seem to reduce lag tooo much. kinda twerks, merhaps?

Try loading the levels of "The Crystal Catacombs" in the editor.

tobbi commented 5 days ago

I tested this somewhat in the editor and stuff...Seems to work.

swagtoy commented 5 days ago

i think it works maybe? idk it doesnt seem to reduce lag tooo much. kinda twerks, merhaps?

What I mean to say is, I encourage unit testing on this, maybe with only "broken" levels, to ensure segfaults or other nonsense won't happen