bug-recutils
[Top][All Lists]
Advanced

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

Re: [bug-recutils] Selection is extremely slow when fields with common n


From: John Darrington
Subject: Re: [bug-recutils] Selection is extremely slow when fields with common name exist
Date: Mon, 12 Aug 2013 19:01:49 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, Aug 08, 2013 at 05:02:14PM +0200, Jose E. Marchesi wrote:
     
     Hi John.
     
         Running the script below, the recsel command takes forever (and 
eventually 
         crashed).  It seems to be related to having multiple fields with the
         same name, 
     
     I just committed a patch with an optimization in the SEX expression
     evaluator: now it does not eval the expression in permutations of field
     names which are _not_ part of the expression.  This makes the evaluation
     of your example sex 

Did you push it?  I don't see any commit which looks like that in the repo.
     
     
     Well, this is better than nothing :) More idas for optimizing the
     evaluator highly welcomed!

Well presumably it's slow because it has to do a linear search through 
the  list of field values.  So the obvious answer would be that for each field,
there should be a hash table keyed on the field value.  That way, the search 
time would go from O(n) to O(1).   But perhaps you had already thought of 
that ...


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.

Attachment: signature.asc
Description: Digital signature


reply via email to

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