Changeset 18815 in josm for trunk/src/org


Ignore:
Timestamp:
2023-08-21T18:42:32+02:00 (10 months ago)
Author:
taylor.smock
Message:

Improve paste behavior of large amounts of data

Both SelectionListDialog and MapStatus can use the consolidated events, which
drastically reduces the amount of time spent pasting large amounts of data. This
reduces the time spent in their listener methods by >99%.

The test paste of 41k objects took ~20s after the change and ~80s prior to the change.

A good chunk of the remaining time spent pasting is from checking to see whether
an upload is needed. Fixing that will take a lot more work, since there is
currently no concept of consolidated events for that specific listener type.

This was found while investigating #4145.

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r18494 r18815  
    961961
    962962        Config.getPref().addPreferenceChangeListener(this);
    963         DatasetEventManager.getInstance().addDatasetListener(this, FireMode.IN_EDT);
     963        DatasetEventManager.getInstance().addDatasetListener(this, FireMode.IN_EDT_CONSOLIDATED);
    964964        SelectionEventManager.getInstance().addSelectionListenerForEdt(this);
    965965
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r18208 r18815  
    175175        SelectionEventManager.getInstance().addSelectionListenerForEdt(actShowHistory);
    176176        SelectionEventManager.getInstance().addSelectionListenerForEdt(model);
    177         DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT);
     177        DatasetEventManager.getInstance().addDatasetListener(model, FireMode.IN_EDT_CONSOLIDATED);
    178178        MainApplication.getLayerManager().addActiveLayerChangeListener(actSearch);
    179179        // editLayerChanged also gets the selection history of the level. Listener calls setJOSMSelection when fired.
Note: See TracChangeset for help on using the changeset viewer.