Page 1 of 1

Assembly definition

Posted: Sat Oct 01, 2022 8:54 am
by forrestuv
Hi,
can you please add an AssemblyDefinition to ur plugin?
Since ur plugin is huge, It would really speedup compile time cause Unity isn't forced to recompile it everytime for no reason.
thx ;)

Re: Assembly definition

Posted: Sat Oct 01, 2022 11:23 am
by Tony Li
Hi,

It already has asmdefs. Look in Plugins/Pixel Crushers/Dialogue System/Scripts and import DialogueSystemAssemblyDefinitions.unitypackage.

The Dialogue System doesn't force devs to use asmdefs because too many asmdefs will slow down a project, and it's already compiled in the Plugins pass, so it doesn't affect compile times of anything that's outside of Plugins.

Re: Assembly definition

Posted: Sun Oct 02, 2022 3:13 am
by forrestuv
References to TextMeshPro are missing when using ur package.
Also can u point me where I can find info on slowdowns using asmdefs?

Below the results of the test I made using asmdef debugger


without
0,76s Assembly-CSharp.dll
compilation total: 0,76s
Assembly Reload Time: 7,6543012s

with
0,71s Assembly-CSharp.dll
compilation total: 0,71s
Assembly Reload Time: 7,5990176s

Re: Assembly definition

Posted: Sun Oct 02, 2022 9:34 am
by Tony Li
Hi,

Some devs don't want to include TextMesh Pro in their projects, so the Dialogue System treats TextMesh Pro as an optional integration. If you've enabled the Dialogue System's TextMesh Pro integration, you must manually assign Unity.TextMeshPro to the PixelCrushers and DialogueSystem asmdefs. The same is true for any other optional Unity package integrations such as Cinemachine.

You can search the forums for benchmarks that people have run to test how the number of asmdefs in a project affects compile times. Once your project gets past ~30 asmdefs, the time Unity takes to determine the dependencies can sometimes take longer than just recompiling everything (disregarding the Plugins folder, which is essentially its asmdefs). This also depends on your version of Unity, since they've been improving the performance of asmdefs over time.

Re: Assembly definition

Posted: Sun Oct 02, 2022 10:37 am
by forrestuv
Ok thank you

Re: Assembly definition

Posted: Mon Feb 06, 2023 5:24 pm
by SealDev
You said: "it's already compiled in the Plugins pass, so it doesn't affect compile times of anything that's outside of Plugins."

Does this still apply if I created a bunch of scripts in the default "Assembly-CSharp" with refrences to either

"using PixelCrushers.DialogueSystem";
or
"using PixelCrushers";
and simple calls to DialogueLua?

Does this trigger a full recompile of the dialogue system?

Re: Assembly definition

Posted: Mon Feb 06, 2023 5:31 pm
by Tony Li
No, it doesn't recompile the Dialogue System in that case.