-
Notifications
You must be signed in to change notification settings - Fork 11
Slippy Threaded - Alpha version #37
Comments
@BergWerkGIS your package is corrupt or something. Did you right click -> export package from Unity? |
Looks like it has to be unzipped on the command line, unzipping from finder unzips into a directory and unzipping on command line unzips to a
@BergWerkGIS but it does look like the SlippyThreaded-01.zip is missing the slippy scene and prefabs; I tried loading the existing slippy scene but wasn't able to get it to run; seems like there are some new ThirdParty libraries as well? @BergWerkGIS Could you export a new package with your updates to the slippy scenes and prefab included? |
Thanks for looking into it. Now a plain ZIP containing just the Download: SlippyThreaded.zip |
@BergWerkGIS First note: I had to change to |
@BergWerkGIS Took me about 3 minutes of scrolling to crash on iOS. Memory grew from about 290mb (starting) to 500+ in that time. Also, on iOS, I was getting some weird unresponsive behavior when trying to drag after completing a the previous drag. I don't know if this is because of our dragging code, or GC spikes from
You can fix this by instantiating a plane prefab instead of using primitives. I saw this on iOS as well. This is more of a design problem that a technical challenge, but for this to be a good slippy map, we should be requesting tiles as the map moves, not just when the drag is finished. You can observe the problem by starting a drag at top of screen and going all the way down without releasing your finger. Also, as previously mentioned, there is a weird delay in dragging twice in a row, which makes it feel unresponsive. This could just be a bug, rather than a performance issues. On a side note, if we make panning the map faster (more sensitive dragging), it will be easier to observe tile loading speed and such. |
@david-rhodes thanks for looking into this:
Same on Windows when exporting to standalone player.
Ok, still more memory profiling necessary
As far as I've been monitoring memory usage it increases heavily when the
I'm not happy with From my point of view I tried all the other methods known to me:
💯% agreed.
|
Finally managed to export I exported via On my devices (
I noticed that too, but it only happened when there was less than ~1sec between my touches. So, part of the problem is likely to be caused by the current dragging code. |
@BergWerkGIS Ok, I think we ignore dragging code for now. I can do a pass on that logic once we integrate into SDK. For the |
@BergWerkGIS Okay I have had a look at this but please bear in mind I'm not very familiar with threading and have only used it in one Unity project beforehand. Here's the ideas I have so far:
I also think in order to really get a deeper understanding of this you will have to write a more fixed test case since from run to run depending on how quickly I would swipe I would get quite different results. Maybe this would be a keyboard shortcut that jumps to the same location on the map each time? I guess we need enough tiles to get loaded in order to see enough of a difference as well. |
@parahunter Wow, that's a lot of valuable information packed into one comment - thanks.
|
Okay tried out not making the labels and still got the memory leak in the mono heap. I would look into all allocations made in the threading code and minimize or remove them. There's a fair amount of EventArgs being created which you could probably get rid off. I am not a fan of EventArgs anyways since you end up creating a wrapper object so you have more to GC. I mentioned this in the first feedback on the SDK back at the start of January but the code base should move towards using object pooling. I would use this both for objects existing in the scene but also for other objects used by the threads for loading in the map to prevent allocations. If all the tiles are pooled you wouldn't have to call UnloadUnusedAssets for instance. |
@BergWerkGIS Just saw this: https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.Dispose.html
|
As mentioned in #40 (comment) I couldn't spot any differences with/without |
Hey @mapbox/games
could you do me a favor and check this
unitypackage
: SlippyThreaded-01.zipIt just contains the
Slippy
demo.Please leave all settings alone (not fully implemented yet) except those two:
^^ These settings are for PC only. In case you are exporting to a mobile player, reduce cached tiles and number of threads as you see fit.
I think the number of cached tiles can stay pretty high tough as this is the raw binary vector tile data and under normal circumstances they
areshould be pretty small - only a few KB.I'm primarily interested in
WebGL
I get:Can't add component because class 'MeshCollider' doesn't exist
.exe
player - except the spikes when textures are created.Do you notice a similar memory usage?
IFileSource
wasnull
. Does this happen on your platform?The text was updated successfully, but these errors were encountered: