Hello, Ricardo Wurmus <rek...@elephly.net> skribis:
> Arun Isaac <arunis...@systemreboot.net> writes: > >> Indeed, I found the bug and fixed it. Please find attached the updated >> code. Also, the inverted index hash table stores package objects instead >> of package names and all comparisons are now done with eq?. This gets us >> an even higher speedup of around 300x. >> >> Built index in 8.556596040725708 seconds >> Brute force search took 0.4107058048248291 seconds >> Inverted index search took 0.0012979507446289062 seconds > > Neat! > > We could build and install the index when Guix is built and installed > and then use it for the search. I can’t think of a downside to adopting > an index compared to what we have now. The possible downsides are (1) ‘guix pull’ will take an additional 8 seconds, (2) there’ll be some extra complexity because the current implementation needs to be kept anyway for when the pre-built index is not authoritative—i.e., when ‘GUIX_PACKAGE_PATH’ is set or when ‘-L’ is used; see ‘cache-is-authoritative?’ in (gnu packages). I don’t find ‘guix search’ to be excessively slow currently (on an SSD at least), but I agree that the speedup would be welcome! Thanks, Ludo’.