Thanks for the nudge to check this on Windows.
I’ve now added a temporary benchmark for the ListBox.AddRow() path and run it on both my M4 Max MacBook Pro and a Windows machine. The benchmark runs Avalonia headless, appends rows through the same Objo ListBox.AddRow() implementation, then verifies that the backing Avalonia DataGrid-visible row source catches up to the logical row count.
The important thing: I’m not seeing the huge slowdown on current main.
On my M4 Max MacBook Pro, after the batching change, 100,000 rows produced:
- native reused array: 34 ms
- lb.AddRow(["A", "B", "C"]): 130 ms
- hidden ListBox + constant array: 126 ms
- i.ToString() array: 75 ms
On Windows, using a Framework Laptop 16 with an AMD Ryzen AI 9 HX 370, Windows 10.0.26200, .NET 10.0.7, 100,000 rows produced:
- native reused array: 63 ms
lb.AddRow(["A", "B", "C"]): 149 ms
- hidden
ListBox + constant array: 104 ms
i.ToString() array: 152 ms
I also ran the same benchmark with 1,000,000 rows on Windows to check for a large-loop, recursion, dispatcher backlog, or memory cliff:
- native reused array: 647 ms total, 21 ms UI catch-up, 1 paint invalidation
lb.AddRow(["A", "B", "C"]): 1,035 ms total, 21 ms UI catch-up, 2 paint invalidations
- hidden
ListBox + constant array: 939 ms total, 20 ms UI catch-up, 2 paint invalidations
i.ToString() array: 1,324 ms total, 22 ms UI catch-up, 2 paint invalidations
Each run finished with the logical row count and displayed row count both exactly matching the requested row count.
So at the moment my working theory is that the batching fix I've made for the next release has probably addressed the main problem. Before that change, every AddRow() synchronously updated the underlying Avalonia DataGrid row collection and triggered UI/layout work per row. Current main updates Objo’s logical row store immediately, but batches the Avalonia-visible row refresh, and for large batches swaps the visible row source in bulk.
That said, this benchmark is still not a full end-user app with a visible window being painted continuously, so there may still be another Windows-specific path to investigate if you can reproduce the slowdown in the next build containing this fix. The original report was against Objo Studio 26.6.2, which does not include this change. Once the next build is available, I’d be very interested to know whether the same million-row test is still slow on your Windows machine.