SuperTux / supertux

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

Cache nfo filename locations #2958

Open tobbi opened 1 month ago

tobbi commented 1 month ago

Well, I thought this would save some startup time but the effect is less than I thought it would be.

Anyway, instead of iterating over all files in each add-on to find the necessary .nfo file, I decided to cache the name of the file for each add-on in the config and then directly ask whether an nfo file can be found at that specific location.

Maybe if you have 1k add-ons installed this will make a noticeable difference.

Vankata453 commented 1 month ago

I think it'd be a good idea to have only 1 accepted name for an add-on .nfo file. For example, info.nfo, or {archivename}.nfo.

I don't see the additional benefit of looking for .nfo files, regardless of name, which is the reason for needing such optimizations.

tobbi commented 1 month ago

Well, there's a lot of add-ons that don't follow that scheme so, thinking of our friend backwards compatibility, I think we should account for that.

Vankata453 commented 1 month ago

Then what about if, for example, an info.nfo file is not found, it goes looking for other .nfo files? With time, the support for .nfo files with other names can be removed, but deprecated for now. The in-game add-on creator in the editor can also be adapted to use the set name.