-1

During our quest to optimize Delphi compile time in general we found some strange difference of compile time between different PCs.

The problem is that on some PCs “raw” compile time is 2 times faster than the slow ones and we simply can’t explain why this should be the case.

Test Setup

  • We tested compile time on 3 different PCs with almost identical configuration. The is PC’s delivered and configured from our IT department with Windows 7 Enterprise 64 bit, service pack 1.

  • Delphi is installed by ourselves and is Delphi XE with update 1.

  • Hw spec is almost identical with Core i7-3770 3,4 GHz 8G Ram and 256 Gb SSD disk.

  • We benchmarked all 3 PCs with almost identical performance on general system, disk and ram.

  • We performed the test with use of command line compilation with dcc32.exe. We tested on different project, all extracted from common source repository.

Tests

After a lot of tests where we looked at different Delphi environment configuration as well as Windows 7 setup. All the test showed similar performance on 2 of the PCs and 1 PC running twice as fast.

Finally we made a simple test file with 1 simple class and a lot of lines which increment a variable. The test file is 32 Mb and is compiled on the fast PC in 1.3s. On the 2 other PCs it takes >3s

Command to do the compile:

"c:\program files (x86)\embarcadero\rad studio\8.0\bin\dcc32.exe" -$O- -$W+ -$J+ -$YD --no-config -B -Q -AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE -DDEBUG; -U;"c:\program files (x86)\embarcadero\rad studio\8.0\lib\Win32\release" -V -VN -K00400000 -GD -NBDcp -NHHpp -NODcp ..\Test.pas

Any idea why compile time is that different on almost identical PCs?

Which tests could we do to troubleshoot the issue?

  • Hard to tell what's going on. I would use SysInternals' Procmon and compare traces between a fast and a slow PC. – whosrdaddy Oct 11 '13 at 07:23
  • Virus-protection software sometimes check the exe every time it compiles. – LU RD Oct 11 '13 at 07:25
  • The machines are different – David Heffernan Oct 11 '13 at 07:29
  • We also initially blaimed the virus scanner, but we managed to turn off the virus scanner and got the same results. – Thomas Dibbern Oct 11 '13 at 07:44
  • The machines might be different yes, but we used different benchmark tools to compare the machines. Its same cpu and same SSD disk, but what could be different to get the one machine running twice as fast. – Thomas Dibbern Oct 11 '13 at 07:48
  • We did try to use Procmon to see if we could get some information about cpu time etc to compare. It was a little difficult to get information as the process seemed to disappear after dcc32.exe was finished compilation. We will give it a try again. – Thomas Dibbern Oct 11 '13 at 07:52
  • Compilation of Delphi tends to be disk bound. Do some disk benchmarks. Also perform benchmarks right after reboot to ensure disk cache not a factor. This is not a valid question for SO probably. No programming here. – David Heffernan Oct 11 '13 at 08:00
  • Voted to close as too broad. There's no way we can provide you a valid answer to your question. Only you can answer it. It could even be something such as the slow computer's disk being fragmented. – Jerry Dodge Oct 11 '13 at 08:58
  • 6
    I think you have probably wasted more time trying to optimise compile time that you would ever loose actually waiting for the code to compile :) – Toby Allen Oct 11 '13 at 09:14
  • Be sure to have all computers defragmented disks, not required if everything is running on an SSD. Also benchmarks the hard disks. Another idea is path. If path is different, then the toosl may take longer to load because they have to be found on a longer path. – fpiette Oct 11 '13 at 11:20
  • Anti-virus tools or anything else that puts hooks into filesystem access can drastically affect compile time. Real Time Protection features in Anti-Virus are the most common SOFTWARE cause. When it's a hardware issue, you would probably see a general overall difference in the benchmarks. Thus I suspect software. – Warren P Oct 11 '13 at 17:46
  • You can try putting the source code on ram drive and then compile. It would help to make sure if the SSD is the issue. I have a large project where difference between compiling from SSD and ram is less than 10% so SSD might not be as bad bottleneck as expected. – Avo Muromägi Oct 11 '13 at 22:48
  • Isn't delphi linked to the .NET installation and -version via MsBuild? Maybe a difference there somehow. – Marco van de Voort Oct 12 '13 at 19:42

1 Answers1

4

As David noted, Delphi compilation is usually disk bound. The most likely explanation is that your SSDs are in various states of "break-in". Even the exact same SSD will perform differently over its lifecycle. Fresh out of the box SSDs have extremely high peak performance that degrades dramatically as the drive starts to build up a use-history. Especially with rather new systems you will see that the SSD performance will change rapidly until the drive is "broken in" and settles at a roughly steady state level.

Many other factors can affect SSD performance as well and a raw benchmark will not reproduce the real-world conditions that can affect the drive's ability leverage its cache or other available performance optimizations.

If you're really interested, this is a good read from the Storage Networking Industry Association on the topic :

Understanding SSD Performance Using the SNIA SSS Performance Test Specification

J...
  • 30,968
  • 6
  • 66
  • 143
  • It seemed that the question was a little too broad. I just wanted to get some feedback to be able to diagnostic the problem to be able to get closer to ask the right question. (-: We did try everything in this thread and other forums. We benchmarked the machines to be able to figure out where the difference is even though it is almost identical HW and SW One “funny” thing is that now we have 2 machines compiling a test project fast and only one slow on. The second PC suddenly went to fast Warp I close the question now and see if I can figure out how to get some support at Embarcadero. Thanks – Thomas Dibbern Oct 11 '13 at 13:25
  • 2
    @ThomasDibbern You are wasting your time with Embarcadero. For 1 you are using a very old compiler. For 2 they will just say that the differences are down to your hardware. – David Heffernan Oct 11 '13 at 13:36
  • I believe the question stated they benchmarked disks to near identical results. – Tuncay Göncüoğlu Aug 20 '17 at 13:48
  • @TuncayGöncüoğlu Not all benchmarks are equal, especially with SSDs. Small block performance may not be captured by all test. In any case, the point is moot - it could have been windows update running, it could have been drive indexing that was running during the tests... antivirus, drop-box sync... any of a hundred possible things. Without hands on the system it's impossible to say. Surely there isn't anything different about Delphi - it's clearly an issue with either hardware or other software on the system. – J... Aug 20 '17 at 15:10