Hi Ricardo,

Ricardo Wurmus <rek...@elephly.net> writes:

>> Why wouldn't it help? Can't you make it a trie from basename -> complete 
>> name? If I'm looking for "libcord.so" (which is a key in the trie), I don't 
>> think I need to look for every path. I only need to follow the trie until I 
>> find a pointer to some structure that contains the data I look for (ex: a 
>> list of complete filenames).
>
> Exactly!  It’s somewhat less useful (without pre-processing) for base
> names and more useful for absolute file names, where you can quickly
> toss out mismatches while traversing the trie.
>
> You could also optimize the data structure by swapping the base name and
> the directory name, assuming that users would want to search for either
> absolute file names and also for base names (and not for a directory in
> between).

By absolute file name, you mean relative to the Guix store item?  As I
mentioned in my reply to Julien, this would be a specific use-case
optimization, like you said it won't work when you don't know the exact
basename or full path, so I'm not sure it's worth going down that road.

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

Attachment: signature.asc
Description: PGP signature

Reply via email to