Ticket #14073 (closed defect: fixed)
Performance issue of adding many items to a sorted wxDVC
| Reported by: | koichi | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | GUI-all | Version: | 2.9-svn |
| Keywords: | wxDataViewCtrl, sort | Cc: | e.raijmakers@… |
| Blocked By: | Patch: | yes | |
| Blocking: |
Description
On wxMSW, adding a huge items to wxDVC takes too long when the tree has sorting column. This is because the tree is sorted every time an item is added. While the behavior is slightly different depending on OSes, the same problem exists on wxGTK, and probably on wxOSX.
In principle, the tree should be sorted only once after the entire items are added. Even if only a part of nodes needs to be sorted after items are added, it is difficult to check which nodes need to be sorted and which nodes need not, and when adding many items, sorting the entire tree is much much faster than sorting a parent node every time an item is added.
Since ItemsAdded internally calls wxDataViewModelNotifier::ItemAdded for each item, I want to temporarily disable sorting function before calling ItemsAdded, and after that call wxDataViewModelNotifier::Resort once.
Is there a good way to temporarily disable sorting?

