[Scummvm-tracker] [ScummVM :: Bugs] #14853: COMMON: Rework path handling causes performance regression
ScummVM :: Bugs
trac at scummvm.org
Thu Aug 7 19:07:53 UTC 2025
#14853: COMMON: Rework path handling causes performance regression
-----------------------------------+----------------------------
Reporter: mikrosk | Owner: lephilousophe
Type: defect | Status: pending
Priority: normal | Component: Common
Version: | Resolution: fixed
Keywords: performance,regression | Game:
-----------------------------------+----------------------------
Comment (by lephilousophe):
Thank you for the elements.
First thing first, the `composeFileHashMap` function is called once per
engine.
The more engines ScummVM gets, the more this function gets called and the
slower the whole thing will get.
This figure is not visible in your data as it doesn't count function
calls.
I did some new tests on Linux, using Callgrind and a folder with 1000
files (as it was slow enough).
The cost per call of composeFileHashMap was still slightly larger in
master than in 2.8.
After more investigation, I didn't find an obvious culprit so I tackled
some function standing out.
That led me to improve the performance of punycode encoding functions,
`scumm_stricmp` and `scumm_strnicmp`.
I also gained some performance by not calling `appendComponent` when not
needed in the detection code.
All of this is currently in master (commit
42b4e7ca10de9d6efb843c58e47a41ff93f6c386).
This makes things faster than master from before, but it can't beat 2.8 as
we gained 10 new engines since then.
Anyway, this makes the `composeFileHashMap` faster than in 2.8 for my test
case so I'd say we are not that bad.
Can you test to check how it goes now?
Note that I don't expect to do better.
--
Ticket URL: <https://bugs.scummvm.org/ticket/14853#comment:10>
ScummVM :: Bugs <https://bugs.scummvm.org>
ScummVM
More information about the Scummvm-tracker
mailing list