[Git][debian-gis-team/josm][master] 2 commits: Add upstream patch to fix copy/paste regression.

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Mon Sep 9 17:21:21 BST 2024



Bas Couwenberg pushed to branch master at Debian GIS Project / josm


Commits:
fcb5dcf7 by Bas Couwenberg at 2024-09-09T18:11:50+02:00
Add upstream patch to fix copy/paste regression.

- - - - -
be82c415 by Bas Couwenberg at 2024-09-09T18:12:02+02:00
Set distribution to unstable.

- - - - -


3 changed files:

- debian/changelog
- debian/patches/series
- + debian/patches/svn-r19214.patch


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+josm (0.0.svn19207+dfsg-2) unstable; urgency=medium
+
+  * Add upstream patch to fix copy/paste regression.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 09 Sep 2024 18:11:51 +0200
+
 josm (0.0.svn19207+dfsg-1) unstable; urgency=medium
 
   * New tested snapshot.


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@
 06-move_data_out_of_jar.patch
 07-use_system_fonts.patch
 08-use_noto_font.patch
+svn-r19214.patch


=====================================
debian/patches/svn-r19214.patch
=====================================
@@ -0,0 +1,68 @@
+Description:  Fix #23908: Significantly improve the performance of copy/paste when dealing with large amounts of data
+ From #23908, at least one valid workflow involves copy/pasting large amounts of
+ data (specifically updating boundaries). The relation for Terwolde in the
+ sample data had 2206 objects. This took >5 minutes to copy between layers. With
+ this change, it takes <1 second.
+ .
+ This is a performance regression from r19176. The primary culprit from r19176 is
+ when we check the size of the dataset. The problem is that we check to see if the
+ size of the primitives being changed is greater than or equal to the non-deleted
+ complete primitives in the dataset. We get a new filtered collection each time
+ we get those primitives, and therefore the size of that is not cached. The size
+ calculation for the filtered collection is where almost all the expense is. We
+ fix that by wrapping the work from AddPrimitivesCommand in DataSet#update to
+ have a single large update at the end of the copy operation. This ensures that
+ we do not have many spurious fired event calls when a mass operation is going on.
+Author: Taylor Smock
+Origin: https://josm.openstreetmap.de/changeset/19214/josm
+Bug: https://josm.openstreetmap.de/ticket/23908
+
+--- a/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
++++ b/src/org/openstreetmap/josm/command/AddPrimitivesCommand.java
+@@ -10,8 +10,6 @@ import java.util.Objects;
+ import java.util.Optional;
+ import java.util.stream.Collectors;
+ 
+-import javax.swing.Icon;
+-
+ import org.openstreetmap.josm.data.osm.DataSet;
+ import org.openstreetmap.josm.data.osm.Node;
+ import org.openstreetmap.josm.data.osm.NodeData;
+@@ -68,6 +66,14 @@ public class AddPrimitivesCommand extend
+     @Override
+     public boolean executeCommand() {
+         DataSet ds = getAffectedDataSet();
++        ds.update(() -> this.executeRealCommand(ds));
++        if (toSelect != null) {
++            ds.setSelected(toSelect.stream().map(ds::getPrimitiveById).collect(Collectors.toList()));
++        }
++        return true;
++    }
++
++    private void executeRealCommand(DataSet ds) {
+         if (createdPrimitives == null) { // first time execution
+             List<OsmPrimitive> newPrimitives = new ArrayList<>(data.size());
+             preExistingData = new ArrayList<>();
+@@ -109,10 +115,6 @@ public class AddPrimitivesCommand extend
+                 }
+             }
+         }
+-        if (toSelect != null) {
+-            ds.setSelected(toSelect.stream().map(ds::getPrimitiveById).collect(Collectors.toList()));
+-        }
+-        return true;
+     }
+ 
+     @Override public void undoCommand() {
+@@ -149,11 +151,6 @@ public class AddPrimitivesCommand extend
+     }
+ 
+     @Override
+-    public Icon getDescriptionIcon() {
+-        return null;
+-    }
+-
+-    @Override
+     public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted,
+             Collection<OsmPrimitive> added) {
+         // Does nothing because we don't want to create OsmPrimitives.



View it on GitLab: https://salsa.debian.org/debian-gis-team/josm/-/compare/fa6fc82fdaf6028caa50cdf40764f048f7f9292d...be82c4150ae5c03d06bbc13ca499c5a4bbe765a1

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/josm/-/compare/fa6fc82fdaf6028caa50cdf40764f048f7f9292d...be82c4150ae5c03d06bbc13ca499c5a4bbe765a1
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240909/c628a51b/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list