mbien opened a new pull request, #9772:
URL: https://github.com/apache/netbeans/pull/9772

   this is plan B. If debouncing the lookup updates isn't feasible 
(https://github.com/apache/netbeans/pull/9771) we have to make the event 
consumers non-blocking. This is trying to avoid to block on clipboard reads 
during selection change until it is required. This change alone fixes the 
performance problem (UI freeze due to queue back pressure can't be provoked 
anymore with the method described in 
https://github.com/apache/netbeans/pull/9771).
   
   However: nobody wants to touch clipboard code given the history, so I wanted 
to avoid this originally.
   
   - `getValue("delegates")` called `ActionStateUpdater.update()`, which on the 
EDT waits up to 100 ms for the "Explorer Actions" task; the paste menu model 
reads "delegates" on every action enabled-state flip, so selection bursts 
serialized the EDT behind the updater, which was itself waiting on X11 system 
clipboard reads
   - make "delegates" a non-blocking read of the current paste types and move 
the flush to `actionPerformed`, so only the user-initiated paste path waits for 
up-to-date types
   - drop stale paste types when an update is scheduled, so the global 
`PasteAction` (which derives its enabled state from the types, not the action 
flag) is corrected by the force-disable event instead of staying enabled with 
stale entries
   - 30 s wall profile while holding an arrow key: EDT busy time drops from 69% 
to 24%
   
   before/after flame graphs (async-profiler):
   
   <details>
   
   before:
   <img width="1200" height="1542" alt="flame-edt-prefix" 
src="https://github.com/user-attachments/assets/0da95c91-870a-421f-8b87-07037db7081c";
 />
   
   after:
   <img width="1200" height="2870" alt="flame-edt-postfix" 
src="https://github.com/user-attachments/assets/cf80a6da-82a9-41f9-b6d4-3e02c987512e";
 />
   
   </details>
   
   
   Assisted-by: qwen3.8-27b


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to