Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.pascal.borland > #192

Re: Virtual Pascal: BlockRead open files (sharedenynone?)

X-Received by 10.157.50.30 with SMTP id t30mr25272935otc.48.1494127248973; Sat, 06 May 2017 20:20:48 -0700 (PDT)
X-Received by 10.157.14.91 with SMTP id n27mr1131197otd.8.1494127248937; Sat, 06 May 2017 20:20:48 -0700 (PDT)
Path csiph.com!weretis.net!feeder6.news.weretis.net!news.glorb.com!c26no1099238itd.0!news-out.google.com!x200ni74itb.0!nntp.google.com!c26no1096504itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.pascal.borland
Date Sat, 6 May 2017 20:20:48 -0700 (PDT)
In-Reply-To <6496c58b-06eb-480d-b7ca-ecd0a9a87b99@googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=2602:306:8371:4220:721a:4ff:feb1:8570; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
NNTP-Posting-Host 2602:306:8371:4220:721a:4ff:feb1:8570
References <ocg1if$qn3$1@dont-email.me> <6496c58b-06eb-480d-b7ca-ecd0a9a87b99@googlegroups.com>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <1cb1bb0c-8a7d-445b-bdf1-eef5eff57894@googlegroups.com> (permalink)
Subject Re: Virtual Pascal: BlockRead open files (sharedenynone?)
From rugxulo@gmail.com
Injection-Date Sun, 07 May 2017 03:20:48 +0000
Content-Type text/plain; charset=UTF-8
Xref csiph.com comp.lang.pascal.borland:192

Show key headers only | View raw


Hi,

On Monday, May 1, 2017 at 10:55:02 PM UTC-5, Jim Leonard wrote:
> On Monday, April 10, 2017 at 8:36:08 AM UTC-5, Robert Prins wrote:
> >
> > All part of a process to convert a Pascal program into pure assembler, which has
> > now reached the stage where all code is actually in-line assembler, making the
> > program rather a lot smaller, and about three times as fast. ;)
> 
> This feels an awful lot like a question you could answer yourself.  In fact, I'll bet you already have...


Not feeling very helpful today, are we, Jim?   ;-)


Robert, I've not looked at your code. In fact, I somewhat doubt I
could help. (I don't really understand FPU/SSE.) But since you claim
you have a pure Pascal version, I would indeed be curious to run it
(preferably in pure DOS). Then again, I think you said it runs in
less than a second, which is hardly a worthwhile benchmark.

Just to explain, I've recently tested some compilers (GPC, FPC, TP55,
VP21) and various high-level tricks to optimize their output. Nothing
fancy, just mild curiosity.

For GPC, the obvious answer is attribute(inline) or let it do it
automatically with either -finline-functions or -O3.

FPC needs "inline" function directive (and -Si). I've seen you
complain about FPC before, but it matches (GCC 3.4.6 / 2005) GPC
in output speed nowadays. Seriously, I would reconsider and try
FPC again. It's very good.

TP55 (and similar) are too old but still work fine. There are
various speedups available there, but of course there are better
compilers nowadays, too.

I think you said Virtual Pascal is slow and generates lousy code.
Not quite true. Sure, it doesn't go past 586, but it's not really
slow. It also has the (Delphi-ish) inline function directive
(same as FPC) but in much more limited functionality, so it's not
nearly as useful. Still, it can help a lot.

The other problem I noticed is that VP does indeed claim to
use (186+) ENTER/LEAVE for nested procs. The docs said that
was for 586, but AFAIK that is for all targets (386, 486, 586).
The docs say it was faster on an actual 586. But I've seen this
problem before. On my Core i5 (admittedly somewhat old, Nehalem
Westmere), that kind of code, when heavily used, is actually
four times slower than the older 8086 equivalent. So try
"flattening" your source to avoid nested procedures (move
them to global scope) and re-benchmark it. It really helps!

Back to comp.lang.pascal.borland | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Virtual Pascal: BlockRead open files (sharedenynone?) Robert Prins <robert@prino.org> - 2017-04-10 16:35 +0000
  Re: Virtual Pascal: BlockRead open files (sharedenynone?) Jim Leonard <mobygamer@gmail.com> - 2017-05-01 20:55 -0700
    Re: Virtual Pascal: BlockRead open files (sharedenynone?) rugxulo@gmail.com - 2017-05-06 20:20 -0700
  Re: Virtual Pascal: BlockRead open files (sharedenynone?) Marco van de Voort <marcov@toad.stack.nl> - 2017-05-07 08:34 +0000
    Re: Virtual Pascal: BlockRead open files (sharedenynone?) Robert Prins <robert@prino.org> - 2018-08-15 20:22 +0000

csiph-web