Name Suggestion Index in JOSM

Is there any way to have the Name Suggestion Index in JOSM?

It is in the JOSM Preset list. You just have to enable it.


Thank you, I didn’t see it.


I tried enable it… seems to lock-up the presets drop down menu for me once enabled :frowning:

1 Like

I saw that too, and I think that’s because the NSI is pretty big now.

Yep. When I took stack dumps, it looked like it was still building the menu.

TBH, I don’t think we should be be building menu items for NSI, but we currently need to. I had a patch set awhile back where I was experimenting with detecting NSI-like presets (AKA no user input) and using those as prefill options in the parent preset tagging window.

Appearing in search is fine, but it really adds a lot to the preset menu.

I just did a bit of profiling. I don’t know what either one of you is running, but on Mac it appears to freeze for ~20 minutes, and most of that time is in Mac OS X native code. I was able to cut the time a bit by turning off preset menu sorting, but that still took ~10 minutes.

On Linux (a Raspberry Pi 4 to be exact), no freeze occurs.

If both of you are on Mac, I suspect it is due to the default Mac Look and Feel. See Help/Preferences/Display for details on how to change it. Just change it off of Mac OS X.

I use Windows 11; the freeze was about 2 seconds long. Not very annoying, but visible.

OK. That isn’t horrible (NSI + JOSM defaults is 21923 presets, of which 20882 are from NSI).

During testing, when I removed 20% of the presets, the time (with the Mac OS X Look and Feel) went from 20 minutes to 2 minutes. So we are looking at O(n^2) or worse with the Mac OS X Look and Feel. I’m pretty certain that it is coming from adding each preset to the menu.

Anyway, I’ve filed an upstream Java bug report with a test case.


I’ve filed an upstream Java bug report with a test case.

Any chance you can link to the JOSM issue so I can follow it?

I’m waiting for the Java bug tracker to give me an actual ticket, but it should appear under Issue Navigator - Java Bug System . If not, I’ll try to update this post with a link.

1 Like

The bug is at [JDK-8297117] Adding 22k JMenuItems to a JMenu tree terminating in a JMenuBar freezes the UI - Java Bug System .

I have no clue if/when it will ever be fixed (it is a P4).

I don’t really think converting the NSI directly to presets is a sensible thing to do to start with, it is just a way to get around the lack of native support in JOSM.

In Vespucci we use the NSI as one of the three data sets that are searched when you enter a string in the preset search field. Potential matches of the search strings in the NSI are then converted on the fly to appropriate preset items for selection (the tags from the NSI are set in the best matching preset).

1 Like