Refactored ResourceNamespace adding an extensible search path grouping mechanic. Added two new search path groups named SPG_OVERRIDE and SPG_FALLBACK to accommodate the additional paths specified on the command-line using e.g., -modeldir2, -modeldir
Refactored PathDirectory, moving in the directory matching duties formerly implemented in PathDirectoryNode.
Optimize: PathDirectory::Find was implemented such that each search path was hashed repeatedly every time we tried to resolve a relative parent relationship. For example, if the search term is "c:\users\documents\danij\games\doom" each fragment (i.e., each directory level, e.g., "\doom") of that path would be hashed * hash_bucket_size.
Instead we now first parse the search term into a list of path fragments and defer hashing until the fragment is first encountered (when matching relative parents) at which point it is stored alongside the fragment. The fragment buffer is considered a shared resource among all instances of PathDirectory and is mutex-locked.
Optimize: PathDirectory::Find now makes use of the stored node hashes in the intern pool to quickly reject fragments before resorting to a full name comparison.
Refactored ResourceNamespace adding an extensible search path grouping mechanic.
Added two new search path groups named SPG_OVERRIDE and SPG_FALLBACK to accommodate
the additional paths specified on the command-line using e.g., -modeldir2, -modeldir
Refactored PathDirectory, moving in the directory matching duties formerly implemented
in PathDirectoryNode.
Optimize: PathDirectory::Find was implemented such that each search path was hashed
repeatedly every time we tried to resolve a relative parent relationship. For example,
if the search term is "c:\users\documents\danij\games\doom" each fragment (i.e., each
directory level, e.g., "\doom") of that path would be hashed * hash_bucket_size.
Instead we now first parse the search term into a list of path fragments and defer
hashing until the fragment is first encountered (when matching relative parents) at
which point it is stored alongside the fragment. The fragment buffer is considered
a shared resource among all instances of PathDirectory and is mutex-locked.
Optimize: PathDirectory::Find now makes use of the stored node hashes in the intern
pool to quickly reject fragments before resorting to a full name comparison.