digitalmars.D.learn - rdmd takes 2-3 seconds on a first-run of a simple .d script
- BoQsc (17/25) May 25 2019 I have a simple standard .d script and I'm getting annoyed that
- Andre Pany (14/39) May 25 2019 If I remember correctly:
- Jon Degenhardt (9/14) May 26 2019 I have seen similar behavior that I attribute to virus scan
- BoQsc (11/26) May 27 2019 The desktop computer I'm testing this on contains Solid State
- Andre Pany (7/19) May 27 2019 I can confirm, without measuring the exact timing, "dmd -run
- Seb (4/12) May 27 2019 Well, that's because rdmd is an old legacy tool that runs the
- BoQsc (29/43) May 28 2019 FOR WINDOWS OPERATING SYSTEMS ONLY
- Andre Pany (8/22) May 28 2019 When I do remember correctly the shebang line has some issue with
rdmd is a companion to the dmd compiler that simplifies the typical edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle. Like make and other tools, rdmd uses the relative dates of the files involved to minimize the amount of work necessary. Unlike make, rdmd tracks dependencies and freshness without requiring additional information from the user.Source: https://dlang.org/rdmd.htmlI have a simple standard .d script and I'm getting annoyed that it takes 2-3 seconds to run and see the results via rdmd. This might sound like insanely laughable time to be annoyed by, but it is a enough of a problem for me to make a Thread in a D lang Forum. Every time I make a change to a script it takes at least 2 seconds on my computer for it to run, if you are beginner like me - you know it is not very pleasant to wait out that duration. I wonder if anything can be done about it, why it takes so "much" time, and why can't the results show up in a few milliseconds instead? import std.stdio, std.process; void main() { writeln("This writeln is taking long time "); executeShell("pause"); }
May 25 2019
On Saturday, 25 May 2019 at 08:32:08 UTC, BoQsc wrote:If I remember correctly: rdmd does one step in the compilation step twice and is therefore slower than dmd. Dmd was in the meantime enhanced to provide the same functionality as rdmd. I assume dmd -i -run myscript.d If you have one file only, you do not need the -i argument. Also please keep in mind there could be other factors like slow disks, anti virus scanners,... which causes a slow down. Dmd also allows you to just test the syntax of your source code file without generating an executable. Kind regards Andrerdmd is a companion to the dmd compiler that simplifies the typical edit-compile-link-run or edit-make-run cycle to a rapid edit-run cycle. Like make and other tools, rdmd uses the relative dates of the files involved to minimize the amount of work necessary. Unlike make, rdmd tracks dependencies and freshness without requiring additional information from the user.Source: https://dlang.org/rdmd.htmlI have a simple standard .d script and I'm getting annoyed that it takes 2-3 seconds to run and see the results via rdmd. This might sound like insanely laughable time to be annoyed by, but it is a enough of a problem for me to make a Thread in a D lang Forum. Every time I make a change to a script it takes at least 2 seconds on my computer for it to run, if you are beginner like me - you know it is not very pleasant to wait out that duration. I wonder if anything can be done about it, why it takes so "much" time, and why can't the results show up in a few milliseconds instead? import std.stdio, std.process; void main() { writeln("This writeln is taking long time "); executeShell("pause"); }
May 25 2019
On Saturday, 25 May 2019 at 22:18:16 UTC, Andre Pany wrote:On Saturday, 25 May 2019 at 08:32:08 UTC, BoQsc wrote:I have seen similar behavior that I attribute to virus scan software. After compiling a program, the first run takes several seconds to run, after that it runs immediately. I'm assuming the first run of an unknown binary triggers a scan, though I cannot be completely sure. Try compiling a new binary in D or C++ and see if a similar effect is seen. --JonI have a simple standard .d script and I'm getting annoyed that it takes 2-3 seconds to run and see the results via rdmd.Also please keep in mind there could be other factors like slow disks, anti virus scanners,... which causes a slow down.
May 26 2019
On Sunday, 26 May 2019 at 20:37:36 UTC, Jon Degenhardt wrote:On Saturday, 25 May 2019 at 22:18:16 UTC, Andre Pany wrote:The desktop computer I'm testing this on contains Solid State Drive, a Windows 10 Home Operating system and about 7-9 years old of hardware. But remember, we are living in a 21 century, the hardware performance is great, even for the old hardware that is 10 years old, especially the desktops. I tried to disable Windows Defender real-time protection, it didn't helped to speed up rdmd. However until I test it on Linux, I can't be sure if Windows do not have other less obvious quirks that could slow down third party programs such as D compiler or rdmd.On Saturday, 25 May 2019 at 08:32:08 UTC, BoQsc wrote:I have seen similar behavior that I attribute to virus scan software. After compiling a program, the first run takes several seconds to run, after that it runs immediately. I'm assuming the first run of an unknown binary triggers a scan, though I cannot be completely sure. Try compiling a new binary in D or C++ and see if a similar effect is seen. --JonI have a simple standard .d script and I'm getting annoyed that it takes 2-3 seconds to run and see the results via rdmd.Also please keep in mind there could be other factors like slow disks, anti virus scanners,... which causes a slow down.
May 27 2019
On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote:On Sunday, 26 May 2019 at 20:37:36 UTC, Jon Degenhardt wrote:I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1 second instead of 2 seconds. Kind regards André[...]The desktop computer I'm testing this on contains Solid State Drive, a Windows 10 Home Operating system and about 7-9 years old of hardware. But remember, we are living in a 21 century, the hardware performance is great, even for the old hardware that is 10 years old, especially the desktops. I tried to disable Windows Defender real-time protection, it didn't helped to speed up rdmd. However until I test it on Linux, I can't be sure if Windows do not have other less obvious quirks that could slow down third party programs such as D compiler or rdmd.
May 27 2019
On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote:On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote:Well, that's because rdmd is an old legacy tool that runs the compiler twice. Use dmd -i or rund (https://github.com/dragon-lang/rund).[...]I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1 second instead of 2 seconds. Kind regards André
May 27 2019
On Tuesday, 28 May 2019 at 06:06:24 UTC, Seb wrote:On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote:FOR WINDOWS OPERATING SYSTEMS ONLY Since I run simple D scripts a lot of time, as an experiment I molded a registry tweak that associate .d files with dmd compiler, with those options in combination: http://dlang.k3.1azy.net/dmd-windows.html#switch-i[ http://dlang.k3.1azy.net/dmd-windows.html#switch-run Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Applications\dmd.exe\shell\open\command] ="\"C:\\D\\dmd2\\windows\\bin\\dmd.exe\" \"-i\" \"-run\" \"%1\"" What this Registry Tweak does: Adds file association for .d file type, so that you can run a .d file by double clicking .d file. To use it: 1. create a simple empty text file 2. change its file extension from .txt to .reg 3. copy the above registry instructions into previously created file. 4. double click this newly created .reg file. 5. confirm that you want to apply these registry changes. Downsides I experienced by using dmd -i and -run switches: .obj and .exe file can be seen generated in the same folder as .d file script, while dmd is running your script. However, they are deleted after the .d script is finished running uninterupted. If dmd is interupted while processing .d script - by being terminated, .obj and .exe files might be left undeleted.On Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote:Well, that's because rdmd is an old legacy tool that runs the compiler twice. Use dmd -i or rund (https://github.com/dragon-lang/rund).[...]I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1 second instead of 2 seconds. Kind regards André
May 28 2019
On Tuesday, 28 May 2019 at 06:06:24 UTC, Seb wrote:On Tuesday, 28 May 2019 at 05:11:15 UTC, Andre Pany wrote:When I do remember correctly the shebang line has some issue with arguments. Just an idea: Instead of removing rdmd, it could be an "alias" to "dmd -i -run"? Kind regards AndréOn Monday, 27 May 2019 at 07:16:37 UTC, BoQsc wrote:Well, that's because rdmd is an old legacy tool that runs the compiler twice. Use dmd -i or rund (https://github.com/dragon-lang/rund).[...]I can confirm, without measuring the exact timing, "dmd -run test.d" feels much faster than "rdmd test.d". I would say 1 second instead of 2 seconds. Kind regards André
May 28 2019