[dev] Links API + performance
Bo Daley
bo at tilda.com.au
Wed Oct 29 00:19:26 PST 2003
Quoting Chuck Hagenbuch <chuck at horde.org>:
> 1. Ditch the SQL driver/serialization for links, and rewrite it to use
> categories (and category_attributes for what's currently serialized).
>
> 2. Make sure that Turba (and other apps) have batch-fetching api calls, where
> you can pass in an array of ids, and get back the info you need for all of
> them.
Attached is a first shot at reworking the Links API to use categories instead of
its own SQL driver. I haven't yet taken this as far as it can go, but already
it has resulted in a significant performance improvement for pages in my system
with large numbers of linked clients. (some of the pages that were previously
taking 20-30 seconds -- eg. the Whups search page -- are now down to about 5
seconds, which makes them a bit more usable).
Things that should be noted before this gets committed:
* I modified Turba so that the backend's read() function returns an array of
contact objects rather than just a single object (which speeds up handling of
large lists of objects). I don't know any ldap so this change will break the
ldap backend unless someone can make the same change to
turba/lib/Driver/ldap.php
* I've included a script (migrate_links.php) that creates links in the new
structure for people who were using clients in Whups. It doesn't update links
for other apps that might have been using Links but I can probably add that in
too if anyone needs it.
* reverse links don't seem to be working just yet. I'll get onto this soon.
more soon... hopefully i haven't missed anything else..(!!)
bo.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: links_to_categories.diff
Type: text/diff
Size: 75624 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20031029/600805cf/links_to_categories-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: migrate_links.php
Type: text/script
Size: 3084 bytes
Desc: not available
Url : http://lists.horde.org/archives/dev/attachments/20031029/600805cf/migrate_links-0002.bin
More information about the dev
mailing list