diff options
author | pommicket <pommicket@gmail.com> | 2023-07-19 15:47:53 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-07-19 19:03:44 -0400 |
commit | 37f6dd7f1027e82fd12c12fca6ff0bae00e4004c (patch) | |
tree | f6ff0e5745b97adb4b418075a6bd33c8a7deec35 /main.c | |
parent | 0d84543e4a88b74aed0dec6a9ceab80b8e44c131 (diff) |
cache buffer_lsp (improves performance a fair bit)
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -1117,13 +1117,6 @@ int main(int argc, char **argv) { buffer_check_valid(&ted->line_buffer); #endif - double frame_end_noswap = time_get_seconds(); - #if PROFILE_FRAME - { - print("Frame (noswap): %.1f ms\n", (frame_end_noswap - frame_start) * 1000); - } - #endif - if (ted->dragging_tab_node) ted->cursor = ted->cursor_move; @@ -1135,6 +1128,8 @@ int main(int argc, char **argv) { SDL_ShowCursor(SDL_DISABLE); } + double frame_end_noswap = time_get_seconds(); + #if !PROFILE_FRAME { // annoyingly, SDL_GL_SwapWindow seems to be a busy loop on my laptop for some reason... // this is why the framerate-cap settings exists @@ -1155,8 +1150,13 @@ int main(int argc, char **argv) { prev_vsync = settings->vsync; SDL_GL_SetSwapInterval(settings->vsync ? 1 : 0); } - SDL_GL_SwapWindow(window); } + #else + (void)frame_end_noswap; + SDL_GL_SetSwapInterval(0); + #endif + SDL_GL_SwapWindow(window); + PROFILE_TIME(frame_end) assert(glGetError() == 0); |