Resharper-unity: Speedup EditorPlugin initialization after DomainReload

Created on 24 Aug 2018  路  12Comments  路  Source: JetBrains/resharper-unity

Repro:
Make sure EditorPlugin is present in the project. Make sure to disable logging.

  1. In Unity Profiler check
    1.1. Profile Editor
    1.2. Deep Profile
    1.3. Clear on Play
  2. Check Record
  3. Click Play
  4. Uncheck Record
  5. Insert "PluginEntryPoint" into the search field
  6. Clean the search field
    See something like
    image

All 12 comments

If we drop support for Unity pre 5.5 - we can use JsonUtility, which is fast, instead of slow JsonConvert.

How about just using StringBuilder? We could drop the whole JSON.NET dependency then.

  1. Don't read / write to freaking disk... (Doesn't matter if its json / xml / stringbuilder) Writing to disk itself is wrong.
  2. if its not a lot of data, just use EditorPrefs directly
  3. If it really for some reason necessary to keep the data via serialization. Then use ScriptableObject to hold & persist the data.

@joeante
In order to keep the connection between Editor and Rider, UnityEditor is writing port to file, Rider watches the file and connects. We are doing it on each AppDomain Reload. I doubt, if we can completely avoid that.

Now PluginEntryPoint.cctor is around 111ms. I removed JsonConvert and optimized logging.

@joeante
In order to keep the connection between Editor and Rider, UnityEditor is writing port to file, Rider watches the file and connects. We are doing it on each AppDomain Reload. I doubt, if we can completely avoid that.

This can be avoided by writing a protocol in C ++, not C #.
C ++ unmanaged dll plugins doesn鈥檛 unload memory even if the solution is reloaded.

We may do it in one of the next releases @Temka193

Did something happen with the latest versions and the last 2021 alpha Unity (a5)?
Initialization times for me are close to 3 seconds (!)

Just noticed this issue is closed. Should I open a new one?

screenshot 2020 11 17-11 48 52

@SugoiDev which Rider package version? Try updating to latest?
I think this problem was fixed in 3.0.2.

It seems pacman is lying and showing 2.0.7 as latest.
Just manually edited the manifest and 3.0.2 indeed has it fixed. Thanks!

I'm still not sure why it isn't showing in pacman though.

I confirm that I see the same Package Manager behaviour. Would be nice if we all report it to Unity. I already did.

I have started a thread about See all versions command in Package Manager https://forum.unity.com/threads/see-all-versions-command-was-removed.1008619/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AmazingThew picture AmazingThew  路  4Comments

justinlueders picture justinlueders  路  5Comments

citizenmatt picture citizenmatt  路  5Comments

mihakrajnc picture mihakrajnc  路  5Comments

RealMSHB picture RealMSHB  路  3Comments