🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #1739

Re: Reals in PS code

#1739
From: Kevin O'Gorman
Date: Thu, 29 Mar 1990 07:03
34 lines
2329 bytes
In article <9612@shlump.nac.dec.com> batcheldern@hannah.enet.dec.com writes:
>
>> The PS books & misc. Adobe tech notes lead me to believe that 
>> real numbers are faster than integers.  No type conversion.
Providing it's being used by an operator that wants a real, of course.
>> 
>> If this is true can I further assume that " 0. " is faster 
>> than "0.0" which is way faster than " 0 " ?
>
>I don't know which is faster, but I would guess that it depends on what
>you are going to do with it, and on what printer. If the machine has a
>really zippy processor, it might be able to do the conversion in less
>time than it took to send the dot. I suggest that if you are really
>desperate for speed, do some experiments in your own environment. If you
>aren't really desperate, then do it whichever way feels better.

There's another consideration that generally weighs in favor of the
0.0 approach in certain cases.  If the constant appears in a procedure
which is executed many times, you want to have the 'natural' data type.
Transmission time is a small issue, because it is transmitted only once.
Therefore, the savings of 0. over 0.0 seem not to be worth it.

The procedure is stored with the numeric object of whatever type the
constant was coded with.  If it needs conversion every time the procedure
is executed, you're wasting time.

On the other hand, I quite agree that you may want to experiment with
different things for constants sent for immediate consumption.  At 9600
baud you're likely to come to one conclusion; on AppleTalk, another. But
then I haven't done such testing and I'm only guessing.
-- 
Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
voice: 805-984-8042 Vital Computer Systems, 5115 Beachcomber, Oxnard, CA  93035
Non-Disclaimer: my boss is me, and he stands behind everything I say.
Technical Details
Message-ID: <1148@kosman.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!srhqla!nrcvax!kosman!kevin
References: <134400012@cdp> <9612@shlump.nac.dec.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!srhqla!nrcvax!kosman!kevin
From: kevin@kosman.UUCP (Kevin O'Gorman)
Newsgroups: comp.lang.postscript
Subject: Re: Reals in PS code
Message-ID: <1148@kosman.UUCP>
Date: 29 Mar 90 07:03:56 GMT
References: <134400012@cdp> <9612@shlump.nac.dec.com>
Organization: K.O.'s Manor - Vital Computer Systems, Oxnard, CA 93035
Lines: 34