diff --git a/.jules/bolt.md b/.jules/bolt.md new file mode 100644 index 0000000..760cb0a --- /dev/null +++ b/.jules/bolt.md @@ -0,0 +1,5 @@ +# Bolt's Journal + +## 2024-05-22 - [First Entry] +**Learning:** Initial setup of the journal. +**Action:** Record future performance insights here. diff --git a/drw.c b/drw.c index 7e99a38..28e915e 100644 --- a/drw.c +++ b/drw.c @@ -494,7 +494,13 @@ void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, } XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); - XSync(drw->dpy, False); + /* + * Optimizing performance by replacing XSync with XFlush. + * XSync forces a round-trip to the X server, waiting for all requests to be processed, + * which causes latency in drawing operations. XFlush ensures the request is sent + * without blocking the client. + */ + XFlush(drw->dpy); } unsigned int drw_fontset_getwidth(Drw *drw, const char *text) {