[commit:
http://hg.dwscoalition.org/dw-free/rev/f18a58c7d31f]
http://bugs.dwscoalition.org/show_bug.cgi?id=4315Efficiency tweaks! Quick summary:
* now only load the information on the comments we need
* make sure we don't end up looking through our hashes over and over again
trying to find unloaded singletons that were actually already loaded.
Implementation Details:
* creates a new sub "preload_props" which takes a list of comments to preload
properties for, so we can load the info for only those comments that we want
to display, rather than trying to preload props for (effectively) every
comment on the entry
* changes the lists of unloaded items into hashes, to make it easy to mark
as loaded. Note: we have this additional data structure so that we don't
need to iterate over all comment singletons in order to find those that
haven't been loaded yet
* make sure we remove from the unloaded list when we absorb_row. Important
because in LJ::Talk::get_talk_data, we create a comment singleton and call
absorb_row for *every* comment in the entry (but have it in the unloaded
data structure, so we iterate over it every time we call preload_rows -- and
we call that a lot)
* clears out the unloaded items hashes when we reset_singletons to avoid a
potential memory leak
Patch by
allen.
Files modified:
- cgi-bin/LJ/Comment.pm
- cgi-bin/LJ/Talk.pm
( Diff: 2 files changed. )