Windows 上的可执行模块是否有理想的大小?

发布于 2024-08-02 10:08:16 字数 327 浏览 3 评论 0原文

我一直在记录许多应用程序的 .exe 文件大小。

我看到Visual Studio 2005的.exe大小为453KB,VS2008为1.04MB,因为它们将应用程序分为许多部分(.exe +许多.dll文件)。

我还看到 MS Outlook 有一个非常大的 .exe 文件(11.8MB),而 MS Word 非常小(398KB)!

在思考了我所看到的事情之后,我留下了以下问题:

  1. 即使应用程序的最终大小(加载的所有 DLL)大得多,拥有较小的 .exe 是否有优势?
  2. 如果是这样,那么开始将应用程序分解为单独的模块的大小合适?

I've been taking note of the .exe file size of many applications.

I saw that Visual Studio 2005 has an .exe size of 453KB, and VS2008 of 1.04MB because they divide the application into many parts (.exe + many .dll files).

I saw also that MS Outlook has a very large .exe file (11.8MB) while MS Word is very small (398KB)!

After pondering the things that I had seen, I was left with these questions:

  1. Is there an advantage to having a small .exe, even if the final size of the application (all DLLs loaded) is much larger?
  2. And if so, at what size is it good to begin breaking up an application into separate modules?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

荒岛晴空 2024-08-09 10:08:16

大型可执行文件可能具有较少的共享库(可重用代码较少),这意味着该应用程序可能比使用共享库的应用程序占用更多内存。如果您想要一个内存占用最小的系统,那么您需要共享库。

大的 exe 可能更加独立,这可能更容易保持稳定的部署。

A large executable probably has less less shared libraries (less re-usable code), meaning that the application probably is more memory intensive than an application using shared libraries. If you want a system with minimal memory footprint you want shared libraries.

A big exe is likely to be more self-contained, which might make it easier to keep a stable deployment.

戏舞 2024-08-09 10:08:16

作为一般规则,大尺寸的 exe 可能意味着您将所有依赖项收集在单个文件中,因此不会出现像 dll 这样的依赖项问题地狱但是每次你想修复小模块中的任何东西时,用户都必须下载这个大exe!

另一方面,小 exe 可能意味着您将应用程序模块化为不同的模块,因此很容易单独维护和升级这些模块,并且用户无需下载大块 exe

As a general rule, big size exe may mean you collect all the dependencies in single file so no dependency problem like dll hell but every time you want to fix any thing in small module the user has to download this big exe!!!

On the other hand small exe it may mean you modularize your application to different modules so it is easy to maintain and upgrade these modules separately and user does not have to download the big chunk exe

王权女流氓 2024-08-09 10:08:16

这些文章:

深入研究 Win32 可移植可执行文件格式

第 1 部分第 2 部分

似乎是文件格式的非常好的摘要Windows 可执行文件(和 DLL)使用。

据我所知,作者没有提到任何关于可执行文件的特定大小是否优于较小/较大大小的内容。

因此,这可能意味着可执行文件的大小对于 Windows 来说并不重要。

另一方面,我认为当您在 Windows 中打开可执行文件时,病毒扫描程序(如果有)会先扫描该文件,然后再将文件交给操作系统执行。因此,这可能意味着,较大的可执行文件意味着在存在扫描应用程序的情况下启动时间较长。

These articles:

An In-Depth Look into the Win32 Portable Executable File Format

Part 1, Part 2

Seem to be a very nice summary of the file format the Windows executables (and DLLs) use.

As far as I have been able to see, the author nowhere mentions anything about whether a certain size for an executable is better than a smaller/bigger size.

So this could mean that the size of an executable doesn't really matter to Windows.

On the other hand, I think that when you open an executable in Windows, the file will be scanned by Virus Scanners (if any) prior to handing off the file to the OS for execution. So this could mean, that larger executable means longer startup time in the presence of a scanning application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文