Hi!
> Ouch! That rsort() in getRecents() has got to hurt. It's
> reverse-sorting the entire changelog.
I wondered when anybody would find this ;-)
> Can we assume that the changelog is properly chronological, so no
> *sorting* is necessary?
Yes
> I'd suggest using array_reverse(), but it would be even better just to
> do a regular for-loop iterating from the last line to the first line.
There was a problem with array_reverse in some PHP versions which is why
it got replaced with rsort
> How big can the changelog get? Does DokuWiki ever truncate or splice
> it? Unless it gets astonishingly huge, I doubt the time to read the
> file into memory has much effect on page load times, but it will
> certainly have an effect on the server's peak capacity. That's a lot
> of string objects.
It can grow indefinitively and it gets never truncated. So yes this is a
lingering problem.
> From a server availability perspective, it would be better to
> periodically archive the changelog, sort of the way Apache
> periodically archives access_log with dot-number extensions. I bet
> the little bit of additional slowdown scanning from log to log would
> be unnoticable, even without caching.
Either that or we simply read the logfile backwards line by line instead
of loading the whole thing into an array.
I'll see if I can fix this today.
Andi
--
http://www.splitbrain.org
--
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist