[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inverted index to accelerate guix package search

From: Ludovic Courtès
Subject: Re: Inverted index to accelerate guix package search
Date: Thu, 16 Jan 2020 15:44:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)


Ricardo Wurmus <address@hidden> skribis:

> Arun Isaac <address@hidden> 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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]