Benchmark loading of individual posts

main
Bob Mottram 2020-08-28 22:15:21 +01:00
parent fcf848b969
commit fd6c36cb57
1 changed files with 17 additions and 0 deletions

View File

@ -5093,6 +5093,8 @@ def htmlTimeline(defaultTimeline: str,
# show each post in the timeline # show each post in the timeline
for item in timelineJson['orderedItems']: for item in timelineJson['orderedItems']:
timelinePostStartTime = time.time()
if item['type'] == 'Create' or \ if item['type'] == 'Create' or \
item['type'] == 'Announce' or \ item['type'] == 'Announce' or \
item['type'] == 'Update': item['type'] == 'Update':
@ -5114,6 +5116,14 @@ def htmlTimeline(defaultTimeline: str,
preparePostFromHtmlCache(currTlStr, preparePostFromHtmlCache(currTlStr,
boxName, boxName,
pageNumber) pageNumber)
# benchmark cache post
timeDiff = \
int((time.time() -
timelinePostStartTime) * 1000)
if timeDiff > 100:
print('TIMELINE POST CACHE TIMING ' +
boxName + ' = ' + str(timeDiff))
if not currTlStr: if not currTlStr:
# read the post from disk # read the post from disk
currTlStr = \ currTlStr = \
@ -5131,6 +5141,13 @@ def htmlTimeline(defaultTimeline: str,
showIndividualPostIcons, showIndividualPostIcons,
manuallyApproveFollowers, manuallyApproveFollowers,
False, True) False, True)
# benchmark cache post
timeDiff = \
int((time.time() -
timelinePostStartTime) * 1000)
if timeDiff > 100:
print('TIMELINE POST DISK TIMING ' +
boxName + ' = ' + str(timeDiff))
if currTlStr: if currTlStr:
itemCtr += 1 itemCtr += 1