Extra benchmark

main
Bob Mottram 2020-08-28 23:54:37 +01:00
parent 700131bb13
commit 748193b359
1 changed files with 31 additions and 0 deletions

View File

@ -4293,6 +4293,11 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
' |" title="' + translate['Undo mute'] + \ ' |" title="' + translate['Undo mute'] + \
'" src="/' + iconsDir+'/unmute.png"/></a>\n' '" src="/' + iconsDir+'/unmute.png"/></a>\n'
# benchmark 13.1
timeDiff = int((time.time() - postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 13.1 = ' + str(timeDiff))
replyAvatarImageInPost = '' replyAvatarImageInPost = ''
if showRepeatIcon: if showRepeatIcon:
if isAnnounced: if isAnnounced:
@ -4308,6 +4313,10 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
'" src="/' + iconsDir + \ '" src="/' + iconsDir + \
'/repeat_inactive.png" class="announceOrReply"/>\n' '/repeat_inactive.png" class="announceOrReply"/>\n'
else: else:
# benchmark 13.2
timeDiff = int((time.time() - postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 13.2 = ' + str(timeDiff))
announceNickname = None announceNickname = None
if attributedTo: if attributedTo:
announceNickname = getNicknameFromActor(attributedTo) announceNickname = getNicknameFromActor(attributedTo)
@ -4318,6 +4327,10 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
announceDisplayName = \ announceDisplayName = \
getDisplayName(baseDir, attributedTo, personCache) getDisplayName(baseDir, attributedTo, personCache)
if announceDisplayName: if announceDisplayName:
# benchmark 13.3
timeDiff = int((time.time() - postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 13.3 = ' + str(timeDiff))
if ':' in announceDisplayName: if ':' in announceDisplayName:
announceDisplayName = \ announceDisplayName = \
addEmojiToDisplayName(baseDir, httpPrefix, addEmojiToDisplayName(baseDir, httpPrefix,
@ -4338,6 +4351,12 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
announceAvatarUrl = \ announceAvatarUrl = \
getPersonAvatarUrl(baseDir, announceActor, getPersonAvatarUrl(baseDir, announceActor,
personCache) personCache)
# benchmark 13.4
timeDiff = int((time.time() - postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName + ' 13.4 = ' + str(timeDiff))
if announceAvatarUrl: if announceAvatarUrl:
idx = 'Show options for this person' idx = 'Show options for this person'
replyAvatarImageInPost = \ replyAvatarImageInPost = \
@ -4408,6 +4427,12 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
personCache) personCache)
if replyDisplayName: if replyDisplayName:
if ':' in replyDisplayName: if ':' in replyDisplayName:
# benchmark 13.5
timeDiff = int((time.time() -
postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName +
' 13.5 = ' + str(timeDiff))
repDisp = replyDisplayName repDisp = replyDisplayName
replyDisplayName = \ replyDisplayName = \
addEmojiToDisplayName(baseDir, addEmojiToDisplayName(baseDir,
@ -4416,6 +4441,12 @@ def individualPostAsHtml(recentPostsCache: {}, maxRecentPosts: int,
domain, domain,
repDisp, repDisp,
False) False)
# benchmark 13.6
timeDiff = int((time.time() -
postStartTime) * 1000)
if timeDiff > 100:
print('TIMING INDIV ' + boxName +
' 13.6 = ' + str(timeDiff))
titleStr += \ titleStr += \
' <img loading="lazy" title="' + \ ' <img loading="lazy" title="' + \
translate['replying to'] + \ translate['replying to'] + \