- Home /
Dynamic linking library more optimized?
What is more vs optimized? Using a c# dll or just sticking everything in unity without a namespace?
Answer by jashan · Dec 09, 2009 at 06:10 PM
Regarding performance, there is simply no difference at all.
Regarding workflow: It very much depends on your project size and how much code you want to reuse. It may be helpful to have several Visual Studio projects that go into several DLLs, using namespaces etc.; if you have very large projects and a lot of code you want to reuse. For smaller projects, this kind of overhead won't make sense.
If you're on the iPhone, you can only have a limited amount of DLLs, so for that plattform, you should definitely keep as much as possible in the Unity project and avoid using your own DLLs.
Answer by Ashkan_gc · Nov 18, 2009 at 08:01 AM
scripting is a powerful tool for many tasks and it has many advantages: it is platform independent and you don't need to write different codes for different platforms. it's easier than coding in unmanaged languages like C++ but it's slower. .NET/MONO code is too fast and you don't need to use other languages in most cases but if you have algorithms that they are complex and they need to run many times it's a good idea to write them in C++ and then call them from unity. AI and path finding are good examples. there are also other situations that you need special features of a specific platform or you need to communicate with a special hardware and in those situations you need to write C++ or C code too.
Answer by Ricardo · Nov 19, 2009 at 05:24 PM
I'm unclear on what you mean by "vs optimized". Do you mean code performance, or Visual Studio ease of use?
On performance, the very short version is that even if you add your C# code as scripts, Unity will end up building it to a DLL. At the end of the day, it'll be the same.
Regarding Visual Studio usability, there will be no difference other than you obviously can't edit the precompiled DLL, but as long as there's a reference to it, you'll still get autocomplete and compilation working without a problem.
Your answer
![](https://koobas.hobune.stream/wayback/20220613162428im_/https://answers.unity.com/themes/thub/images/avi.jpg)