From fd6c36cb57cf731b674314b8c6fa63318f26109f Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 28 Aug 2020 22:15:21 +0100 Subject: [PATCH] Benchmark loading of individual posts --- webinterface.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webinterface.py b/webinterface.py index 976fdbb6..76492110 100644 --- a/webinterface.py +++ b/webinterface.py @@ -5093,6 +5093,8 @@ def htmlTimeline(defaultTimeline: str, # show each post in the timeline for item in timelineJson['orderedItems']: + timelinePostStartTime = time.time() + if item['type'] == 'Create' or \ item['type'] == 'Announce' or \ item['type'] == 'Update': @@ -5114,6 +5116,14 @@ def htmlTimeline(defaultTimeline: str, preparePostFromHtmlCache(currTlStr, boxName, pageNumber) + # benchmark cache post + timeDiff = \ + int((time.time() - + timelinePostStartTime) * 1000) + if timeDiff > 100: + print('TIMELINE POST CACHE TIMING ' + + boxName + ' = ' + str(timeDiff)) + if not currTlStr: # read the post from disk currTlStr = \ @@ -5131,6 +5141,13 @@ def htmlTimeline(defaultTimeline: str, showIndividualPostIcons, manuallyApproveFollowers, False, True) + # benchmark cache post + timeDiff = \ + int((time.time() - + timelinePostStartTime) * 1000) + if timeDiff > 100: + print('TIMELINE POST DISK TIMING ' + + boxName + ' = ' + str(timeDiff)) if currTlStr: itemCtr += 1