[dev] Re: [klutz]Fwd: call tree from portal.php

Rick Emery rick at emery.homelinux.net
Sun Feb 23 21:25:30 PST 2003


Sorry; once again, I forgot to attach the patch.

----- Forwarded message from rick at emery.homelinux.net -----
    Date: Mon, 17 Feb 2003 15:59:44 -0500
    From: Rick Emery <rick at emery.homelinux.net>
Reply-To: Rick Emery <rick at emery.homelinux.net>
 Subject: Re: [klutz]Fwd: call tree from portal.php
      To: klutz at lists.horde.org

Quoting Jan Schneider <jan at horde.org>:

> See attached message.

I was planning to try more clean-up and optimization, but I just haven't had the
time. So, I thought I'd submit what I have so far and see what everybody thinks.

One of the problems I saw with the klutz.profile that Jan posted was that there
are a *lot* of calls for sorting. On my portal page, I display a random comic
each time the portal page refreshes (currently every five minutes). If I
understand the code correctly (*please* let me know if I'm wrong), a Klutz
object is instantiated on each refresh of the portal page. The constructor for
the Klutz class sorts all of the comics by name. So, each time my portal page
refreshes, the comics are sorted. Since I only display one comic on the portal
page, there's no reason to sort the list.

So, the attached patch causes the constructor to default to not sort (but still
allows the constructor to sort in case it's required in the future) and only
sorts the comics when displaying in klutz (as opposed to the portal).

This may not be the best solution, and I may not even have the sort in the right
place in comics.php, but I just haven't had time to dive in further and it
should eliminate a lot of function calls in the call tree from portal.php (I
couldn't verify this as I never did get the PEAR apd working). I intend to
revisit this as time permits and hopefully submit additional patches.

As always, I am open to any suggestions/comments/criticism.

Thanks,
Rick


----- End forwarded message -----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: klutz.patch
Type: text/diff
Size: 680 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20030223/bba54317/klutz-0001.bin


More information about the dev mailing list