madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r23089: LJSUP-13883: Journal pages optimizaiton ...

Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1
U   trunk/cgi-bin/LJ/S2/RecentPage.pm
Modified: trunk/cgi-bin/LJ/S2/RecentPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/RecentPage.pm	2012-10-10 10:53:42 UTC (rev 23088)
+++ trunk/cgi-bin/LJ/S2/RecentPage.pm	2012-10-10 12:03:22 UTC (rev 23089)
@@ -1,7 +1,6 @@
 use strict;
 package LJ::S2;
 
-use LJ::DelayedEntry;
 use LJ::Entry::Repost;
 use LJ::UserApps;
 
@@ -153,6 +152,10 @@
     my $sticky_appended  = !$u->has_sticky_entry() || $skip;
     my $ljcut_disable    = $remote ? $remote->prop("opt_ljcut_disable_lastn") : undef;
     my $replace_video    = $remote ? $remote->opt_embedplaceholders : 0;
+    
+    my %all_users;
+    
+    $all_users{$u->userid} = $u;
 
   ENTRY:
     foreach my $item ( @items ) {
@@ -334,10 +337,15 @@
             'real_itemid'    => $repost_entry_obj ? $repost_entry_obj->jitemid : undef,
         });
         
+        $all_users{$entry_obj->posterid} = $entry_obj->poster;
+        
         push @{$p->{'entries'}}, $entry;
         LJ::run_hook('notify_event_displayed', $entry_obj);
 
     } # end huge while loop
+    
+    my $prefetch_props = ['custom_usericon', 'custom_usericon_individual'];
+    LJ::load_user_props_multi([keys %all_users], $prefetch_props);
 
     # mark last entry as closing.
     $p->{'entries'}->[-1]->{'end_day'} = 1 if @{$p->{'entries'} || []};

Tags: livejournal, madeon, pm, sbelyaev
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