Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Realm on UWP causing Massive MonoCompile.Tick() times in Unity #3413

Open
DevHazzardt opened this issue Aug 5, 2023 · 4 comments
Open

Comments

@DevHazzardt
Copy link

DevHazzardt commented Aug 5, 2023

What happened?

Recently we included realm in our unity project and noticed that when switching to mobile platfroms the performance was consistent, however when switching to UWP after switch compilations a MonoCompile.Tick() would appear lasting for around 4 minutes. I did some digging and found it was nothing to do with local defines or scene differences between platforms and that the delay immediately goes away if I disable realm.

I download Editor Iteration Profile for unity to check this and found that on mobile unity's
UnityEditor.CoreModule.dll!UnityEditor.Scripting.ScriptCompilation::EditorCompilationInterface.TickCompilationPipeline() [Invoke]
lasts about 211 ms and has a GC alloc size of 30.5 MB
UWP on the other hand had
245556 ms with a GC alloc of 3.22GB

I tried to get more info with the deep profiling but I always run out of memory before I can get more information, but one of the most obvious differences is that the GC alloc itself has 99977017 calls. the mobile only has 59817 for context.

I have been suspecting it is something to do with our UWP version of realm but am unsure how to debug this further with my memory limitations.

UWP:
4fd92907-35d2-4739-851c-77e2ad299a80

a47b9309-f841-456c-a31b-3fae86e725b1

Mobile:

d17d9ab7-95ef-4d8a-ae91-36fa5e406425

3bb85e53-8022-4316-b1cd-5180a133ba44

(I should note that after the compile is over everything works fine, it's just that the platform switch takes up a LOT of our time currently.)

Repro steps

Setup a project with realm in unity and have it ready for multiple platforms.
Switch platforms to something like mobile and it should be very reasonable
Switch to UWP and after the switch the MonoCompile.Tick() should be drastically longer

Version

11.0.0

What Atlas Services are you using?

Local Database only

What type of application is this?

Unity

Client OS and version

Windows 10 (KB5028166) (I think also iOS but unsure)

Code snippets

No response

Stacktrace of the exception/crash you're getting

No response

Relevant log output

No response

@nirinchev
Copy link
Member

Is there a minimal repro project you can upload here that would allow us to try and debug the issue locally? It's not something I've seen previously, so my guess is that it's not happening in all cases, which is why a repro project would go a long way.

@DevHazzardt
Copy link
Author

DevHazzardt commented Aug 7, 2023

Is there a minimal repro project you can upload here that would allow us to try and debug the issue locally? It's not something I've seen previously, so my guess is that it's not happening in all cases, which is why a repro project would go a long way.

Will try to see if I can reproduce this in a new project then as it would be hard to share this project

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Aug 9, 2023
@DevHazzardt
Copy link
Author

@nirinchev Is there a contact e-mail with which I should share this zip it is a little to big for the git upload limit

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Aug 9, 2023
@nirinchev
Copy link
Member

You can send it to me - nikola.irinchev@mongodb.com.

@sync-by-unito sync-by-unito bot removed the Needs-Attention Reporter has responded. Review comment. label Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants