🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #525

Re: Performance - DOS mode contra GUI .

#525
From: Klaus J. Koch
Date: Thu, 17 Aug 2000 00:00
24 lines
1783 bytes
Eddy Vluggen wrote:

> Don't call 16bit routines or use 16 bit DLL's. Any good with C++? Put much
> used functions in a .OBJ file, and bind it into your program. Or even
> better, find an assembler guru!

It's not that easy. If you are using a pentium cpu, simply clock
cycle counting won't help because certain instructions can be
performed simultaneously. The guys at Borland who write the
compilers know what code to generate to obtain fastest executables.

The other day I spent my time to convert 3 lines of pascal code into
more than 50 lines of highly optimized assembler code avoiding slow
commands as loops, jumps, calls, and pushs, and it ended up in
taking 5 per cent _more_ cpu time than the compiler generated code.

A hint that hasn't been given yet might be helpful:
sometimes you often have to call a function that takes a lot of time.
If there are only a small amount of values that are passed to that
function then you can precalculate all the results and store them
in an array to fetch them when needed.
That's what a pentium does internally when executing a DIV instruction.

Klaus
Technical Details
Message-ID: <7k26wEf91hB@klaus.mr.he.schule.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <u8mm5.822$0L1.13011@news010.worldonline.dk> <399b304d$0$1695@heracles>

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
From: klaus@mdi.mr.he.schule.de (Klaus J. Koch)
Subject: Re: Performance - DOS mode contra GUI .
Date: 2000/08/17
Message-ID: <7k26wEf91hB@klaus.mr.he.schule.de>
X-Deja-AN: 659533431
References: <u8mm5.822$0L1.13011@news010.worldonline.dk> <399b304d$0$1695@heracles>
Newsgroups: comp.lang.pascal.delphi.misc,alt.comp.lang.borland-delphi,borland.public.delphi.winapi