Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r21491: LJSUP-11603 (optimize performance of S2 ...

Committer: ailyin
LJSUP-11603 (optimize performance of S2 comments pages)
U   trunk/cgi-bin/LJ/S2/EntryPage.pm
Modified: trunk/cgi-bin/LJ/S2/EntryPage.pm
===================================================================
--- trunk/cgi-bin/LJ/S2/EntryPage.pm	2012-03-21 12:43:32 UTC (rev 21490)
+++ trunk/cgi-bin/LJ/S2/EntryPage.pm	2012-03-21 13:02:17 UTC (rev 21491)
@@ -133,6 +133,17 @@
         @comments = LJ::Talk::load_comments($u, $remote, "L", $itemid, $copts);
     }
 
+    my @userids = map { $_->{'posterid'} } @comments;
+    push @userids, $remote->userid if $remote;
+    push @userids, $entry->journalid;
+    my $usermap = LJ::load_userids(@userids);
+    my @user_objects = values %$usermap;
+
+    # these three cover Global, GlobalIndexed, and UserClusterLite,
+    # so there should be no further load_props after this call
+    my @props_to_load = qw( custom_usericon sticky_entry_id timezone );
+    LJ::load_user_props_multi( \@user_objects, \@props_to_load );
+
     my $tz_remote;
     if ($remote) {
         my $tz = $remote->prop("timezone");
@@ -140,6 +151,7 @@
     }
 
     my $pics = LJ::Talk::get_subjecticons()->{'pic'};  # hashref of imgname => { w, h, img }
+    my ($last_talkid, $last_jid) = LJ::get_lastcomment();
     my $convert_comments = sub {
         my ($self, $destlist, $srclist, $depth) = @_;
 
@@ -227,7 +239,6 @@
             }
 
             # Comment Posted Notice
-            my ($last_talkid, $last_jid) = LJ::get_lastcomment();
             my $commentposted = "";
             $commentposted = 1
                  if ($last_talkid == $dtalkid && $last_jid == $remote->{'userid'});

Tags: ailyin, andy, livejournal, pm
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