简体   繁体   中英

High traffic when opening a network directory including executables made with Delphi XE with windows explorer

I've started to work in home office and connected my Windows 10 PCs to the network drives in the company through VPN. I noticed there was a lot of traffic on the VPN and tried to find out why. I noticed that when I open a directory with the Windows Explorer on a network drive the data transfer is raised by hundreds of MB. So I started some tests. I disabled all Virus Scanners and so on, which might access the network drive and made multiple duplicates of the same file until i had 1GB in a directory. I made one directory with only PDFs, one with a executable from another company and one with executables made by me. A standard Delphi XE application. What I found out:

  1. If there is a directory including only PDFs. There is only a little traffic
  2. If there is a directory with an executable from another company for example the "Affinity" graphic editor. There is also only a little traffic
  3. If there is an executable made by me with Delphi XE. There is over 1GB traffic. The Windows Explorer shows the files, but not the icons. After all data is transferred the icons show up one by one.

I tried to find out why there is a difference between the two executables or what exactly is happening, but couldn't find out why and how to solve this.

While I'm not sure about this I'm guessing that the cause for this is the size of resource section of Delphi executables.

You see most other compilers create executables with pretty small resource sections which contain only executable icons, version information and included manifest file.

Delphi on the other hand stores much more information in that resource section like:

  • several default mouse cursors
  • several bitmaps that store several standard icons that can be shown on various buttons
  • executable icons
  • several default strings that can be shown on various error messages
  • RCData which contains information about all included packages and all DFM's that are needed for creating forms with the same layout as they were designed during design time.
  • version information
  • built in manifest
  • and of course all other resources that you have added to your project

Because of all this the resource section of Delphi files can easily exceed several MB in size. You can use one of various PE resource viewers or resource editors to get better idea of what exactly is stored in resource sections of Executable files. I most commonly use PE Explorer for this.

And since Windows has to retrieve entire resource sections in order to be able to extract executable icons this causes so much network traffic when opening a network folder with lots of executables that were built with Delphi.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM