[dokuwiki] Re: Recent changes
- From: Ben Coburn <btcoburn@xxxxxxxxxxxxx>
- To: dokuwiki@xxxxxxxxxxxxx
- Date: Sun, 24 Sep 2006 09:48:43 -0700
On Sep 24, 2006, at 9:41 AM, Chris Smith wrote:
Ben Coburn wrote:
Chris,
I'm confused, or maybe you misunderstood how I intended the changelog
trimmer to work....
The original intent was for the recent changes to be trimmed to
everything newer than N days OR X lines (which ever was larger).
Where N=$conf['recent_days'] and X=$conf['recent']. In a fast moving
wiki N may equal one week or even one day, but a slower moving wiki
could use N of one month or more. In a slow moving wiki (if no one
edited anything over the holidays) it would be better to have the
most recent stale changes still visible, instead of no changes. This
is why I added the clause to keep at least X changes when trimming
the recent changes log.
Hi Ben,
Ok, I missed that, you're new comment does it make it much clearer.
:-)
You're updated patch will work fine with a correctly ordered
changelog, but it will have problems if the ordering is messed up.
Given the much reduced size of the changelog cache, carrying out a key
sort costs very little time and I think the extra robustness is worth
it. e.g. on my server, with 53 out of order entries in the change
log, its takes 0.5ms to reorder them (indexer.php takes 85ms to run
from start to finish).
Also, anyone who has been using a darcs version of snapshot from the
last few weeks will have an incorrectly ordered recent changes cache
which needs fixing ;-)
On reflection my method of simply creating keys using the change time
is flawed as it is possible for two changes to be made in the same
second. Below is my patch to update last night's changes:
I don't see any reason to make the trimmer more complicated. The
ksort() you added to getRecents() will already cleanup any out of order
lines in the recent changes cache. The changelog caches of wiki's
running the darcs snapshot will turn over in about $conf['recent_days']
days.
Regards, Ben Coburn
-------------------
silicodon.net
-------------------
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist
- Follow-Ups:
- [dokuwiki] Re: Recent changes
- From: Chris Smith
- References:
- [dokuwiki] Recent changes
- From: Chris Smith
- [dokuwiki] Re: Recent changes
- From: Ben Coburn
- [dokuwiki] Re: Recent changes
- From: Chris Smith
Other related posts:
- » [dokuwiki] Recent changes
- » [dokuwiki] Re: Recent changes
- » [dokuwiki] Re: Recent changes
- » [dokuwiki] Re: Recent changes
- » [dokuwiki] Re: Recent changes
- » [dokuwiki] Re: Recent changes
- » [dokuwiki] Re: Recent changes
On Sep 24, 2006, at 9:41 AM, Chris Smith wrote:
Chris,
I'm confused, or maybe you misunderstood how I intended the changelog trimmer to work....
The original intent was for the recent changes to be trimmed to everything newer than N days OR X lines (which ever was larger). Where N=$conf['recent_days'] and X=$conf['recent']. In a fast moving wiki N may equal one week or even one day, but a slower moving wiki could use N of one month or more. In a slow moving wiki (if no one edited anything over the holidays) it would be better to have the most recent stale changes still visible, instead of no changes. This is why I added the clause to keep at least X changes when trimming the recent changes log.
Hi Ben,
Ok, I missed that, you're new comment does it make it much clearer. :-)
You're updated patch will work fine with a correctly ordered changelog, but it will have problems if the ordering is messed up. Given the much reduced size of the changelog cache, carrying out a key sort costs very little time and I think the extra robustness is worth it. e.g. on my server, with 53 out of order entries in the change log, its takes 0.5ms to reorder them (indexer.php takes 85ms to run from start to finish).
Also, anyone who has been using a darcs version of snapshot from the last few weeks will have an incorrectly ordered recent changes cache which needs fixing ;-)
On reflection my method of simply creating keys using the change time is flawed as it is possible for two changes to be made in the same second. Below is my patch to update last night's changes:
------------------- silicodon.net -------------------
- [dokuwiki] Re: Recent changes
- From: Chris Smith
- [dokuwiki] Recent changes
- From: Chris Smith
- [dokuwiki] Re: Recent changes
- From: Ben Coburn
- [dokuwiki] Re: Recent changes
- From: Chris Smith