Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: [PATCH] Two issues with the gnus-registry
Date: Sat, 08 Nov 2014 16:39:48 +0800	[thread overview]
Message-ID: <87mw82jdbf.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <8761eqlfvk.fsf@ericabrahamsen.net>

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>
>>>> Ted Zlatanov <tzz@lifelogs.com> writes:
>>>
>>> [...]
>>>
>>>>> The registry has ERT tests, which I thought covered this case.  Can you
>>>>> look at `tests/gnustest-registry.el'?  As a first step, can you try
>>>>> making tests to demonstrate the problems?
>>>>
>>>> Will do.
>>>
>>> Okay, turns out there were tests, but the bit that tests pruning was
>>> commented out :)
>>>
>>> This is the first in a (gradual) series of patches. It does very little
>>> except:
>>>
>>> 1. Adjust `registry-prune' to do what the docstring says: return the
>>> total number of entries pruned
>>>
>>> 2. Uncomment the pruning test and adjust it so it correctly catches the
>>> number of pruned entries.
>>>
>>> Test should fail. Over the next couple of days I'll add another test to
>>> check that entries are sorted correctly before pruning, and then take a
>>> stab at fixing the pruning itself.
>>
>> Okay I realized it didn't make too much sense to patch gnus just to make
>> it fail, so here's a complete patch, with passing tests, that preserves
>> precious entries when pruning. I haven't done the sorting yet, that will
>> be a separate patch.
>
> And of course seconds later I realized that the test didn't quite match
> the logic of the function, here's a new version.

Nope, I still can't make this work -- I just don't get the relationship
between max-hard and max-soft. If max-soft is higher than max-hard, then
it will never get used at all. When the registry reaches max-hard in
size it will get pruned back, but pruned back to what size? To (*
max-soft prune-factor)? But that's likely already higher than
max-hard. To (* max-hard prune-factor)? In which case, what's the point
of max-soft?

If max-soft is less than max-hard, then it makes more sense -- when we
reach max-hard, we prune down to max-soft. But in that case the
prune-factor isn't really useful -- we might as well just prune directly
to max-soft, since pruning won't happen again until we're back up to
max-hard.

So unless I'm really missing something, my proposal is:

1. Only provide one limit: max-size.
2. Allow customization of prune-factor.

That seems like all the customization you'd need. Cap the size, and
provide a reasonable control of how often the registry gets pruned.

That would require a change in the object signature, which would mean
some extra handling code for "upgrading". But once we're doing that, we
could also take the opportunity to add :prune-function and
:sort-function slots on the base registry object, which would be
nice. We could even change the default store filename from its "eioio"
extension to "eieio". :)

Eric




  reply	other threads:[~2014-11-08  8:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 19:04 Eric Abrahamsen
2014-10-24 20:56 ` Eric Abrahamsen
2014-10-25 19:59   ` Eric Abrahamsen
2014-10-27 15:03 ` Ted Zlatanov
2014-10-27 19:15   ` Eric Abrahamsen
2014-10-28 18:04     ` Eric Abrahamsen
2014-11-07 23:56       ` Eric Abrahamsen
2014-11-08  0:01         ` Eric Abrahamsen
2014-11-08  8:39           ` Eric Abrahamsen [this message]
2014-11-10 13:54             ` Ted Zlatanov
2014-11-11  2:55               ` Eric Abrahamsen
2014-11-13 12:05               ` Eric Abrahamsen
2014-11-16  1:04                 ` Dan Christensen
2014-11-16  3:24                   ` Eric Abrahamsen
2014-12-18 10:07                 ` Ted Zlatanov
2014-12-18 15:00                   ` Eric Abrahamsen
2014-12-18 15:09                     ` Eric Abrahamsen
2014-12-19  0:44                       ` Katsumi Yamaoka
2014-12-19  2:08                         ` Eric Abrahamsen
2014-12-20  3:09                         ` Ted Zlatanov
2014-12-20 11:22                           ` Katsumi Yamaoka
2014-12-20 13:53                             ` Older Emacsen (was: [PATCH] Two issues with the gnus-registry) Ted Zlatanov
2014-12-19  1:30                       ` [PATCH] Two issues with the gnus-registry Ted Zlatanov
2014-10-28 20:10     ` Ted Zlatanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mw82jdbf.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).