debug: add timing instruments to cache precalculation and screen refresh
parent
7d3a555464
commit
1364b41dc9
11
src/color.c
11
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 */
|
||||
|
|
10
src/winio.c
10
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue