Article View: comp.lang.pascal.delphi.misc
Article #518Re: Performance - DOS mode contra GUI .
From: Eddy Vluggen
Date: Mon, 21 Aug 2000 00:19
Date: Mon, 21 Aug 2000 00:19
57 lines
4134 bytes
4134 bytes
>> 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. What would then be fastest? >_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?) Ah - the reasoning of 'IF'. What IF? Well, it doesn't. Altough it would be hard, nor wise for a project, it is not said impossible. And, OK, assembly for a 8086 *can* slower than optimized basic code. But while were laying salt on each snail, it also depends on the programmer. "IF" you have a good programmer of basic, then this would be better THEN a lame asm programmer. So, I agree on all six points. OTOH, if compared in equal terms.. (You don't test a Maserati on sand, and compare that to a Volvo on a hardened road) >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... From this angle, an interpreted language could beat the hare.. Find me an optimized turtle, and we race! Bottom line; you don't write complete projects in ASM. One would write the small pieces wich are often used - Comparing the languages this way, I see a big advantage over ASM - IF used under the right conditions, and by an abled programmer (not me ;-) For writing your next news-reader, I suggest an optimized and higher language. For small and often used calculations (e.g. Power, Log etc) I prefer asm.. If I were an asm-programmer that is.. >my $.02 >Dima Your contribution is appreciated much more than that :) Eddy Vluggen vluggen@cuci.nl
Technical Details
Message-ID:
<39a0753c$0$1584@heracles>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed.germany.net!news.netcologne.de!newsfeed.wirehub.nl!news.cybercomm.nl!transit.news.cuci.nl!cuci.nl!newspost.cuci.nl!not-for-mailReferences:
<u8mm5.822$0L1.13011@news010.worldonline.dk><399b304d$0$1695@heracles> <7k26wEf91hB@klaus.mr.he.schule.de> <399dc3d7$0$1701@heracles> <399DFF6D.97DDF9BF@crosswinds.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fd817,8b5ff9f09340286e X-Google-Attributes: gidfd817,public X-Google-Thread: 1091e5,8b5ff9f09340286e X-Google-Attributes: gid1091e5,public X-Google-Thread: 10baee,8b5ff9f09340286e X-Google-Attributes: gid10baee,public X-Google-ArrivalTime: 2000-08-20 20:00:51 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed.germany.net!news.netcologne.de!newsfeed.wirehub.nl!news.cybercomm.nl!transit.news.cuci.nl!cuci.nl!newspost.cuci.nl!not-for-mail From: "Eddy Vluggen" <vluggen@cuci.nl> Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.winapi References: <u8mm5.822$0L1.13011@news010.worldonline.dk><399b304d$0$1695@heracles> <7k26wEf91hB@klaus.mr.he.schule.de> <399dc3d7$0$1701@heracles> <399DFF6D.97DDF9BF@crosswinds.net> Subject: Re: Performance - DOS mode contra GUI . Date: Mon, 21 Aug 2000 02:19:31 +0200 Organization: Cubic Circle X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Lines: 63 Message-ID: <39a0753c$0$1584@heracles> NNTP-Posting-Host: 10.1.5.19 X-Trace: newspost.cuci.nl 966817084 1584 10.1.5.19