[Top][All Lists]

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

Re: [Nano-devel] WIP: Use caching for regex

From: Benno Schulenberg
Subject: Re: [Nano-devel] WIP: Use caching for regex
Date: Sat, 3 Nov 2018 20:37:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

Op 03-11-18 om 04:39 schreef Devin Hussey:
> Here is my patch, I am not going to duplicate the details.

What the heck?  How am I supposed to comment on it here if
you don't attach the patch?

> For a real example, instead of this O(n^2) strcmp tree:

??  How does a series of comparisons have a performance in the
order of n squared?  If we add two more bindable functions, on
average it will take one more comparison to rebind a function.
Linear.  Unless you assume that the user always wants to rebind
all available functions.

<Snip all other irrelevant stuff>.

Your testing of the regex caching patch is misleading.  You
include the same bunch of nanorc more than twenty times.  Yes,
if you include the same regex twentyfold, sure you are going
to see some performance improvement from hashing/caching.

The test that matters, though, is how much you gain when you
include all the nanorc files just once, as will be the case
in most circumstances.  And instead of writing the hashing
and caching stuff first, it would have been better to check
how many identical regexes there are in the current nanorcs
(that are included with nano).  And again when you delete the
near duplicate objc syntax.  Less than ten percent?  Then it's
not worth expending much effort to make this faster.  And for
sure not when it adds more than three hundred lines of code.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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