From cdc7f1a30cd52e0733494f83eb227b4d5873fb32 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sat, 31 Oct 2020 23:28:47 +0100 Subject: [PATCH] Add stopswatch for speed of Get() --- file.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/file.go b/file.go index ba92701..a9420c7 100644 --- a/file.go +++ b/file.go @@ -151,6 +151,8 @@ func convertBlocksToListItems(current string, blocks BlockResponse, indent int) } func (fp *FilePages) Get(title string) Page { + var sw stopwatch + sw.Start("Get " + title) // TODO: cleanup loading of pages // TODO: convert all pages to blocks name := title @@ -206,6 +208,8 @@ func (fp *FilePages) Get(title string) Page { err = json.NewEncoder(&buf).Encode(&listItems) + sw.Stop() + return Page{ Name: name, Title: blocks.Texts[name],