4 ms·
A more detailed answer (but still somewhat vague) for those wondering things like "how long are the lines" and "on what hardware" can be found in the linked thr
by userbinator 6y ago
A more detailed answer (but still somewhat vague) for those wondering things like "how long are the lines" and "on what hardware" can be found in the linked thread: "110 cycles per source byte".
Of course, that can vary significantly based on what those bytes actually represent (e.g. scanning through comments should take far fewer cycles than parsing keywords, numerical constants, or other expressions) so the actual "texture" of code being compiled will make a difference.
...and as someone who has spent a lot of time decompiling binaries, the lack of (any!) optimisations Delphi has reflects itself in the code it generates: It's extremely fast because it generates code extremely stupidly. Redundant moves, duplicated instructions(!), and other perplexingly stupid things are frequently seen. I suppose some of that might be a reflection of the quality of the source it was compiled from, but normally those don't show through with C compilers even at O0.
- deleted 6y ago[deleted]
- bjoli 6y agoI wrote a comment about a week ago in this very forum that a non-optimizing compiler should be able to compile about 1MLOC/s [0]. That seems to stay reasonably true a week later. What is more interesting is what tradeoffs you make to produce fast code. Chez scheme produces code that is plenty fast compared to most other scheme compilers, and does so at almost 100KLOC/s on my computer (on generated code that is relatively simple and already macro-expanded). They have strict limits on the time complexity on optimization passes, and even though some people have whined about it it seems to have served chez scheme well. [0]: https://news.ycombinator.com/item?id=24660468 https://news.ycombinator.com/item?id=24660468
- boznz 6y agoDelphi programs are still mainly compiled for windows desktops, I have noticed the binary for the 120K line MPR system I developed for my client has creeped up from about 8MB to 20MB since 2007. My current delphi 10.2 takes 7.2 seconds to do a full compile or about 2 seconds if I just hit the run button and it only has to re-compile the modules I was working on, this has remained pretty consistent over the 13 years since I first wrote it, despite improvements to the hardware. I think people can read too much in to your statement about the stupid source code the compiler generates (which I cannot confirm or deny), as the final exe binary is lightning fast without any optimisations, all performance issues I have ever encountered in Delphi go back to network calls such as REST APIs, MySQL libraries, printing, network drives, etc, good multi-threading can hide most. There are optimisation levels on Delphi but in 20 years I have never felt the need to go off the default. As a developer, I will take near instant compilation over optimisation any day.
- guenthert 6y ago> As a developer, I will take near instant compilation over optimisation any day. Not if your technical marketing department publishes results from performance tests comparing it with the competition. I remember from my use of Turbo Pascal (way back), that it was impressively fast (CP/M version on a Z80A!) and produced at least reasonable good code (better than the awful Small C compiler of that time, partly due to the different calling convention). Moving on to C and later C++, I never had such fast turn around times anymore, but didn't miss them much in a statically typed language either.
- pjmlp 6y agoExcept it is always possible to choose what one wants, C and C++ compilers aren't the only game in town with optimization flags.