mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-08 22:12:56 +00:00
When we repeatedly wait for the same events, it's faster to create the event set once and reuse it. While testing with a sequential scan test case, I saw WaitLatchOrSocket consuming a lot of CPU: > - 40.52% 0.14% postgres postgres [.] WaitLatchOrSocket > - 40.38% WaitLatchOrSocket > + 17.83% AddWaitEventToSet > + 9.47% close@plt > + 8.29% CreateWaitEventSet > + 4.57% WaitEventSetWait This eliminates most of that overhead.