多个项目和.NET性能 [英] Multiple projects and .NET performance

查看:58
本文介绍了多个项目和.NET性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的办公室正在开发一个承诺会很大的.NET应用程序. 200多种表格,谁知道还有多少其他模块.提出的问题是将项目和绩效分开.除了测试,易于开发和代码重用之外,在最终产品中,将所有内容整合到一个项目中还是将解决方案分解为几个较小的项目,是否具有任何性能优势?

解决方案

仅在启动时,但是除非将每个表单放入其自己的程序集中,否则差异可以忽略不计.

我的理论是,表单本质上是特定于应用程序的,因此将代码放入其自己的程序集中是没有意义的.我将可以被该软件套件中的其他应用程序重用的代码放入其自己的程序集中.例如,我现在正在编写一些代码,该代码具有Windows服务组件和winforms组件.它们都利用相同的核心数据对象,因此核心代码位于其自己的程序集中.


如果在一个项目中有200多种表单,那么似乎有些问题.
也许将您的项目分解为较小的项目将在长期运行方面为您提供更好的可维护性和可伸缩性.另外,也许您需要重新考虑技术设计,因为将大型应用程序分成独立的相似组(如助手实用程序,转换函数等)总是有用的.

性能-不会有任何明显的差异.实际上,您可以控制启动时加载的项目数量,从而减少启动期间多个项目的影响.时间,如果将它分解成包含在主应用程序中的单独的库,则我怀疑这是否会超过拆分它的好处.

但是,真正的答案可能是特定于您的应用程序的,只有通过试用并测试结果才能真正找到答案.


My office is developing a.NET app that promises to be quite large. 200+ forms, and who knows how many other modules. The question came up as to separate projects and performance. Issues of testing, ease of development and code reuse aside – in the final product, is there any performance advantage to have everything in one project, or breaking the solution into several smaller projects?

解决方案

Only in startup time, but the difference will be negligble unless you put each form into its own assembly.

My theory is that forms are essentially app-specific, so there''s no point in putting that code into their own assembly/ies. I put code that can be reused by other apps in the suite of software into its own assembly. For instance, I''m writing some code right now that has a windows service component, and a winforms component. They both utilize the same core data objects, so that core code is in its own assembly.


If you have 200+ forms in just one project, then something seems to be wrong.
Maybe breaking your project into smaller projects will help you in terms of better maintainability and scalability in the longer run. Also, maybe you need to rethink on the technical design, as it is always useful to divide a big application into separate similar groups like helper utilities, conversion functions etc.

Performance - there wont be any visible difference. You can actually control the number of projects you load at startup, thus reducing the effect of multiple projects during startup.


I imagine there isn''t much difference, except possibly a little slower load time if it''s broken down into separate libraries that are included into the main application, but I doubt it would be anything that outweighs the benefit of splitting it up.

But the true answer is probably specific to your application, and can only really be discovered by trying it out and testing the results.


这篇关于多个项目和.NET性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆