Modify

Opened 14 months ago

Closed 13 months ago

Last modified 13 months ago

#20720 closed enhancement (fixed)

[Patch] Filtering in plugins list in preferences is slow

Reported by: ygramul Owned by: simon04
Priority: minor Milestone: 21.04
Component: Core Version: latest
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Open preferences
  2. Open the plugins tab
  3. Start typing in the search textbox to filter the list

What is the expected result?

Filtering happens at a reasonable pace

What happens instead?

A large delay, at least for the first 1–2 characters typed.

Please provide any additional information below. Attach a screenshot if possible.

Profiling reveals that creating the components that make up each entry in the plugins list is the slow part; the filtering itself is not noticeable.

I've tried an alternative approach locally that simply builds those UI components once and later hides them for filtering instead of always removing everything and building the list anew. This is noticeably quicker and more responsive.

I've attached the quick patch I've tested with, but I'm not totally sure when and whether to invalidate the map from plugins to UI components, i.e. when the UI actually *has* to be rebuilt, so feedback is appreciated here.

Revision:17702
Is-Local-Build:true
Build-Date:2021-04-03 16:33:26

Identification: JOSM/1.5 (17702 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19042)
Memory Usage: 239 MB / 6124 MB (68 MB allocated, but free)
Java version: 14.0.1+7, AdoptOpenJDK, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel
Screen: \Display0 1920×1200 (scaling 1.00×1.00)
Maximum Screen Size: 1920×1200
Best cursor sizes: 16×16→32×32, 32×32→32×32
Environment variable LANG: en
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
VM arguments: [-Dvisualvm.id=512973165650400, -javaagent:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3\lib\idea_rt.jar=50188:C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3\bin, -Dfile.encoding=UTF-8]

Plugins:
+ CADTools (1008)
+ FastDraw (35640)
+ HouseNumberTaggingTool (35640)
+ OpeningHoursEditor (35640)
+ PicLayer (2a9aa7a)
+ RoadSigns (35640)
+ ShapeTools (1240)
+ Tracer2 (35640)
+ apache-commons (35524)
+ apache-http (35589)
+ auto_tools (73)
+ buildings_tools (35669)
+ continuosDownload (91)
+ contourmerge (v0.1.6)
+ ejml (35458)
+ geotools (35458)
+ imagery_offset_db (35640)
+ jaxb (35543)
+ jna (35662)
+ jogl (1.2.3)
+ jts (35458)
+ kendzi3d
+ kendzi3d-resources (0.0.2)
+ log4j (35458)
+ mapwithai (1.7.1.4)
+ measurement (35640)
+ opendata (35640)
+ scripting (30798)
+ tageditor (35640)
+ terracer (35640)
+ turnlanes-tagging (288)
+ turnrestrictions (35640)
+ utilsplugin2 (35691)

Tagging presets:
+ https://github.com/kendzi/Simple3dBuildingsPreset/releases/download/0.9_2018-05-08/s3db-preset.zip

Map paint styles:
+ https://josm.openstreetmap.de/josmfile?page=Styles/Building_Levels_Labels&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Direction&zip=1
+ https://www.dropbox.com/s/qo3ai47fpv241jf/Styles_Fixme_and_Notes.zip?raw=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Enhanced_Lane_and_Road_Attributes&zip=1
+ https://github.com/igitov/forest-josm-style/archive/master.zip
+ https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/Lit&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Modified&zip=1
+ https://josm.openstreetmap.de/josmfile?page=Styles/MapWithAI&zip=1

Last errors/warnings:
- 00001,690 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00001,697 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00065,778 E: org.openstreetmap.josm.plugins.PluginException: An error occurred in plugin kendzi3d. Cause: java.lang.reflect.InvocationTargetException. Cause: java.lang.NoClassDefFoundError: com/jogamp/opengl/GLEventListener. Cause: java.lang.ClassNotFoundException: com.jogamp.opengl.GLEventListener
- 00065,848 W: Disable plugin - Could not load plugin 'kendzi3d'. Delete from preferences?
- 00067,694 E: Failed to locate image 'MapWithAI'

Attachments (3)

20720.patch (4.4 KB) - added by ygramul 14 months ago.
Patch to improve filtering performance in Plugins Preferences tab
20720-2021-04-12.patch (6.7 KB) - added by ygramul 13 months ago.
Updated patch to improve filtering performance in Plugins Preferences tab
20720-2021-04-13.patch (6.3 KB) - added by ygramul 13 months ago.
Got rid of the map after finding put/getClientProperty again

Download all attachments as: .zip

Change History (10)

Changed 14 months ago by ygramul

Attachment: 20720.patch added

Patch to improve filtering performance in Plugins Preferences tab

comment:1 Changed 14 months ago by simon04

Summary: Filtering in plugins list in preferences is slow[Patch] Filtering in plugins list in preferences is slow

comment:2 in reply to:  description ; Changed 13 months ago by Don-vip

Replying to Johannes Rössel <josm@…>:

I've attached the quick patch I've tested with, but I'm not totally sure when and whether to invalidate the map from plugins to UI components, i.e. when the UI actually *has* to be rebuilt, so feedback is appreciated here.

It must be rebuilt when the plugin list is updated using the "Download list" button.

comment:3 Changed 13 months ago by Don-vip

Milestone: 21.04

Changed 13 months ago by ygramul

Attachment: 20720-2021-04-12.patch added

Updated patch to improve filtering performance in Plugins Preferences tab

comment:4 in reply to:  2 Changed 13 months ago by ygramul

Replying to Don-vip:

It must be rebuilt when the plugin list is updated using the "Download list" button.

I've attached a new patch. Also added some documentation. Hopefully it's not too horrible; I admittedly haven't looked around that much to see how the code style looks overall.

Changed 13 months ago by ygramul

Attachment: 20720-2021-04-13.patch added

Got rid of the map after finding put/getClientProperty again

comment:5 Changed 13 months ago by simon04

Owner: changed from team to simon04
Status: newassigned

comment:6 Changed 13 months ago by simon04

Resolution: fixed
Status: assignedclosed

In 17784/josm:

fix #20720 - Filtering in plugins list in preferences is slow (patch by ygramul)

comment:7 Changed 13 months ago by simon04

In 17785/josm:

see #20720 - Filtering in plugins list in preferences is slow (simplify)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain simon04.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.