commit 1364b41dc97fcd3081906d880cf746991e05de9a
parent 7d3a555464e1b6b4b55ea7929b95cb47f04c0efb
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 26 Jan 2021 15:41:02 +0100
debug: add timing instruments to cache precalculation and screen refresh
Diffstat:
2 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/src/color.c b/src/color.c
@@ -299,6 +299,12 @@ void precalc_multicolorinfo(void)
openfile->filetop->multidata || ISSET(NO_SYNTAX))
return;
+//#define TIMEPRECALC 123
+#ifdef TIMEPRECALC
+#include <time.h>
+ clock_t start = clock();
+#endif
+
/* For each line, allocate cache space for the multiline-regex info. */
for (line = openfile->filetop; line != NULL; line = line->next)
set_up_multicache(line);
@@ -372,6 +378,11 @@ void precalc_multicolorinfo(void)
}
}
}
+
+#ifdef TIMEPRECALC
+ statusline(INFO, "Precalculation: %.1f ms", 1000 * (double)(clock() - start) / CLOCKS_PER_SEC);
+ napms(1200);
+#endif
}
#endif /* ENABLE_COLOR */
diff --git a/src/winio.c b/src/winio.c
@@ -3359,6 +3359,12 @@ void edit_refresh(void)
draw_scrollbar();
#endif
+//#define TIMEREFRESH 123
+#ifdef TIMEREFRESH
+#include <time.h>
+ clock_t start = clock();
+#endif
+
line = openfile->edittop;
while (row < editwinrows && line != NULL) {
@@ -3378,6 +3384,10 @@ void edit_refresh(void)
row++;
}
+#ifdef TIMEREFRESH
+ statusline(INFO, "Refresh: %.1f ms", 1000 * (double)(clock() - start) / CLOCKS_PER_SEC);
+#endif
+
place_the_cursor();
wnoutrefresh(edit);