From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 08 05:02:08 2020 Received: (at 39258) by debbugs.gnu.org; 8 Mar 2020 09:02:08 +0000 Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jArp1-0000Gy-Um for submit@debbugs.gnu.org; Sun, 08 Mar 2020 05:02:08 -0400 Received: from mugam.systemreboot.net ([139.59.75.54]:55482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jAroy-0000D9-Mw for 39258@debbugs.gnu.org; Sun, 08 Mar 2020 05:02:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=systemreboot.net; s=default; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=4/wT/fafeenlTNLNNGegj//mrkuKxN6QDSDIWcy+GE8=; b=hZfB10G7R6YUgpAVczEoAsuVj Ec26IdseUmbFztjkIeVN4hlzDUi8j/s48KCFL72M1eds10h2DChT14Tw5a8x9+9unQWot5fWXdm+i PKT/s23nyX/pF5ipa3Op5jfSsbtAhb/CiR1qzXxGocSLjPmRGb/mhxirwYFaWSd6vTwWk=; Received: from [192.168.2.1] (helo=steel) by systemreboot.net with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1jAroo-002fZg-Rs; Sun, 08 Mar 2020 14:31:55 +0530 From: Arun Isaac To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH v2 0/3] Xapian for Guix package search In-Reply-To: <87sgijgb1v.fsf@gnu.org> References: <20200307133116.11443-1-arunisaac@systemreboot.net> <87sgijgb1v.fsf@gnu.org> Date: Sun, 08 Mar 2020 14:31:42 +0530 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 39258 Cc: mail@ambrevar.xyz, 39258@debbugs.gnu.org, zimon.toutoune@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> It turns out that most of the time is spent in printing and texinfo >> rendering of the search results. Also, when we put all package metadata into the Xapian index, we don't have to look up any of the package variables in (gnu packages *) during `guix search` time. This also contributes substantially to the speedup. > In general, pre-rendering doesn=E2=80=99t seem practical to me: the outpu= t of > =E2=80=98guix search=E2=80=99 is locale-dependent (it speaks the user=E2= =80=99s language) and Note that we already need to index package synopses and descriptions in all languages. I still haven't implemented this, though. > adjusts to the terminal width (well, this is temporarily broken on > Guile 3.0.0, but see =E2=80=98%text-width=E2=80=99 in (guix ui)). This could be accomplished even with pre-rendering. Xapian provides "slots" to store arbitrary strings with a document. Instead of storing the pre-rendered document as a whole, we could store pre-rendered fields in separate slots. Then, during `guix search` time, we can assemble the result from these pre-rendered fields. > Also, if the 12K+ descriptions need to be rendered at the time the user > runs =E2=80=98guix pull=E2=80=99, the experience may not be great, becaus= e it could take > a bit of time. This is a problem, but I would see it as a necessary "compilation" step. :-P In fact, this whole patchset speeds up `guix search` by doing part of the work of `guix search` ahead of time. So, some such cost is unavoidable. > What I like about the recutils format in this context is that it=E2=80=99= s both > human- and machine-readable. The examples in the manual show how it can > be useful to select the information displayed or to refine the search > (info "(guix) Invoking guix package"). Xapian's query language is much more natural (as in natural language) than the regexp based techniques we need to use with recutils. I have hardly ever used the regexp based search and I suspect many others haven't either. Also, refining the search query should be easier to do with Xapian. We could even use Xapian's query expansion feature to suggest improved queries to the user. That said, if we want the recutils format, we can still keep it in a simplified form like so. name: inkscape version: 0.92.4 synopsis: Vector graphics editor name: inklingreader version: 0.8 synopsis: Wacom Inkling skecth format conversion and manipulation > Also: I=E2=80=99d recommend tackling one thing at a time. :-) I totally agree, but I'm tempted to say that pre-rendering would be a lot cheaper with the simplified form of search results. :-) > Were you able to measure the cost of rendering specifically? generate-package-search-index takes around 50 seconds. If I modify generate-package-search-index to not pre-render but simply store the package description alone, it takes around 20 seconds. That gives us a rough idea of the cost of pre-rendering. > I think we should look at a profile of =E2=80=98package->recutils=E2=80= =99, there=E2=80=99s > probably room for improvement there. On quick inspection, most of the time in package->recutils is spent in texinfo rendering the description. Unless we use the simplified search results format as discussed above, we cannot avoid it. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEf3MDQ/Lwnzx3v3nTLiXui2GAK7MFAl5ktHYACgkQLiXui2GA K7NqqQgAnPZx1ilBTQfl8kAoHTyQrdcdhL//PI4LHFMtfYqi+s+AnYvu10jNVM9K lPX2AL3hDRcDYSJL1r2KQ+uicc/FZwY9qWVPg5axflohUnwa6pzn7LDnJ3U5ClU/ ON5uY7Vh6nixBjsIMwMqklRSWb2Lk/VEYTM9+HYUXCPgpvTzUz1XuJN5IP6YeXMo EIIMpOUVFz3Qxg3bZqPXSZ29gxAg+KdS3DhtK4zgmeFZTBeT+81Lld6rDy1q68Y3 kwyFKmiLSsg0XWRStK5tai7J0h7snN+/EM4SkORjOGBlEnsUPQSYfeRnAUXy2f5Y kxw+OnaWgsrF+UtGYrWAg4+SLo0ocw== =rzzL -----END PGP SIGNATURE----- --=-=-=--