Tilemap.GetUsedTilesCount appears to block execution when there are many different tiles

I’m trying to determine if this is worth a bug report: unsure if anyone would consider this a bug.

I have V3 of a replacement UI Toolkit-based Tilemap editor (“Painter”) soon to release on the Asset Store and was trying it out with some third-party tile palettes. Some of these are what I’d consider huge: one was ~7K different tiles and another ~8K different tiles.

Painter displays the name of a palette in a list. Part of the string displayed includes showing the number of different tiles in the palette. After adding these huge palettes I would encounter issues where the Unity Editor would appear to freeze: the usual popup window would appear but no info is displayed in the background task list.

Using some of the debug switches in the editor preferences I was able to watch what occurs: to make a long story short, a whole lot of asset access/manipulation(?) under the hood. The real problem is that UsedTileCount blocks execution until it’s done.

So I added a workaround to ignore such huge palettes. But the blocking would still happen at runtime. Its unfortunate that this info isn’t cached in the Tilemap somehow but no…

I’m confused whether anyone would consider this a reportable bug.