The problem was caused, because the items were added individually instead of 
batched. Here is a performance comparison created with a profiler.

| Before | After |
| --- | --- |
| <img width="912" height="489" alt="image" 
src="https://github.com/user-attachments/assets/794314ef-09d6-49e1-bbbe-d2f1a5c97cf2";
 />|<img width="922" height="497" alt="Screenshot 2026-03-20 202806" 
src="https://github.com/user-attachments/assets/e3a38fde-97dc-4889-a229-3539787c60e9";
 />|

The tests added here back up the functionality of the choice box itself since 
this is just a performance improvement.

-------------

Commit messages:
 - 8303060: ChoiceBox: adding ~1000 items takes a long time

Changes: https://git.openjdk.org/jfx/pull/2118/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2118&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8303060
  Stats: 102 lines in 2 files changed: 67 ins; 11 del; 24 mod
  Patch: https://git.openjdk.org/jfx/pull/2118.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2118/head:pull/2118

PR: https://git.openjdk.org/jfx/pull/2118

Reply via email to