vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r22641: LJSUP-13301: Main page optimization

Committer: vad
LJSUP-13301: Main page optimization
U   trunk/cgi-bin/LJ/NotificationItem.pm
Modified: trunk/cgi-bin/LJ/NotificationItem.pm
===================================================================
--- trunk/cgi-bin/LJ/NotificationItem.pm	2012-08-14 14:59:59 UTC (rev 22640)
+++ trunk/cgi-bin/LJ/NotificationItem.pm	2012-08-14 15:41:15 UTC (rev 22641)
@@ -120,10 +120,21 @@
     my @items;
     while (my $row = $sth->fetchrow_hashref) {
         my $qid = $row->{qid} or next;
-        my $singleton = $u->{_inbox_items}->{$qid} or next;
+        $u->{_inbox_items}->{$qid} or next;
+        push @items => $row;
+    }
 
-        push @items, $singleton->absorb_row($row);
-    }
+    ## preload journal objects
+    LJ::load_userids( map { $_->{journalid} } @items );
+
+    @items = map {
+            my $row = $_;
+            my $qid = $row->{qid} or next;
+            my $singleton = $u->{_inbox_items}->{$qid} or next;
+
+            $singleton->absorb_row($row);
+        } @items;
+    
 }
 
 # fills in a skeleton item from a database row hashref

Tags: livejournal, pm, vad, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments