Article View: comp.lang.pascal.delphi.misc
Article #520Re: Performance - DOS mode contra GUI .
From: Dima Maziuk
Date: Fri, 18 Aug 2000 00:00
Date: Fri, 18 Aug 2000 00:00
44 lines
3366 bytes
3366 bytes
Eddy Vluggen wrote: > ... > If I'm not mistaken, then Pascal is converted to machine language. Is asm > not a one-on-one construction of machine language? The first thing I learned > about computer is that the fastest way to program is in machine language! You mean, fastest code is written in machine language? That's what compilers are for -- to translate stuff into machine language. > Now, it is assumed that Pascal is generally slower than C. And C would be > slower than asm. If your code is slower than Delphi, than this means that > the Borland Group has some good geeks stached in their basements! _Generally_ is the keyword. In Real Life (tm) it seldom works that way. 1. Look at target CPU. "General" cpu is assumed to execute instructons sequentially. P6 core doesn't: it runs them in parallel and has its own built-in optimizer with branch prediction and other arcane magic. Assembly code that's written with "general" cpu in mind may well be slower than Basic optimized for P6. (Add backwards compatibility here & have endless fun with 2,3,4,586 instructions on a P6...) 2. Did I mention instruction caches? -- oh well I won't... 3. Look at target OS. Benchmarking makes sense only in MS-DOS where your program is the only thing that's running. It also has all the resources. Once you move to a grown-up os, even as lame as '95, you run into schedulers, dynamic priority boosts, average job mixes and all that. You also run into resource management, like paging, where you can have fun with things like working set size and related optimizations (did I mention caching?) So it's not very surprising that a compiler that optimizes for NT on P6 will produce _much_ faster code than one that only does "general" optimizations... provided you run the code under NT on a P6 of course. Compilers are very smart nowadays; I suspect it doesn't matter anymore what [compiled] language you use -- it's the compiler that does the magic. Thus, assembly vs C vs Pascal is not a valid comparison anymore. It's Borland's compiler vs Microsoft compiler vs whatever... my $.02 Dima -- I'm not crazy. I've just been in a very bad mood for 30 years. -------------------------------------------------------------- Setting Orange, 11 Bureaucracy 3166, 246:1:2 (1)
Technical Details
Message-ID:
<399DFF6D.97DDF9BF@crosswinds.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<u8mm5.822$0L1.13011@news010.worldonline.dk><399b304d$0$1695@heracles> <7k26wEf91hB@klaus.mr.he.schule.de> <399dc3d7$0$1701@heracles>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1091e5,8b5ff9f09340286e X-Google-Attributes: gid1091e5,public X-Google-Thread: 10baee,8b5ff9f09340286e X-Google-Attributes: gid10baee,public X-Google-Thread: fd817,8b5ff9f09340286e X-Google-Attributes: gidfd817,public From: Dima Maziuk <dmaziuk@crosswinds.net> Subject: Re: Performance - DOS mode contra GUI . Date: 2000/08/18 Message-ID: <399DFF6D.97DDF9BF@crosswinds.net> X-Deja-AN: 659971160 Content-Transfer-Encoding: 7bit References: <u8mm5.822$0L1.13011@news010.worldonline.dk><399b304d$0$1695@heracles> <7k26wEf91hB@klaus.mr.he.schule.de> <399dc3d7$0$1701@heracles> X-Accept-Language: en,ru Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@doit.wisc.edu X-Trace: news.doit.wisc.edu 966655855 15290 128.104.53.79 (19 Aug 2000 03:30:55 GMT) Organization: University of Wisconsin, Madison Mime-Version: 1.0 NNTP-Posting-Date: 19 Aug 2000 03:30:55 GMT Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.winapi