[Info-vax] BASIC, Performance, and Stack Walking
Dave Froble
davef at tsoft-inc.com
Mon Dec 17 10:40:47 EST 2018
On 12/17/2018 9:14 AM, John Reagan wrote:
> On Sunday, December 16, 2018 at 10:35:34 PM UTC-5, Stephen Hoffman wrote:
>> On 2018-12-17 02:25:15 +0000, Tim Sneddon said:
>>
>>> Part of the BASIC prologue requires the routine to hunt for some sort
>>> of context.
>>
>> Some of the previous discussions...
>> https://groups.google.com/d/msg/comp.os.vms/OVTUn9GDHPo/tdohHkGo2nQJ
>> https://groups.google.com/d/msg/comp.os.vms/a58LJeU8FvQ/5jLe-0-6BQAJ
>>
>> That DBASIC$IO_NO_SIGNAL logical name means the C feature logical name
>> design morass has infested BASIC, too.
>>
>> --
>> Pure Personal Opinion | HoffmanLabs LLC
>
> I was hoping nobody would mention that as I hope that nobody uses it
> and I can remove it.
>
> Here's the story:
>
> #1 Every BASIC routine calls into the RTL in the routine prologue to
> walk up the stack looking for any active BASIC frames to verify that
> the scale factor is identical. Apparently, if they aren't, a hole
> opens in the space-time continuum.
I've never used that scale factor, and never heard of anyone doing so.
But I don't get out much.
> This stack walk is cheap on Alpha
> but expensive on Itanium. The RTL was updated for Itanium to do this
> as quick as possible, but it still hurts on Itanium. You can turn
> off that RTL call with OPTION INACTIVE=SETUP but several different
> BASIC language features will turn it back on (see the BASIC User
> Manual). We are thinking to simplify the RTL's per-routine overhead
> and not to do that check by default. BASIC already turns on
> checking by default (ie, /CHECK=(BOUNDS,OVERFLOW). I want to add an
> off-by-default /CHECK=SCALE_FACTOR setting.
How much would this help? Sure sounds like a great idea to me. Might
affect someone else.
> #2 The BASIC RTL will signal RMS errors, like file-not-found, on IO
> statements. Programs that normally rely on such signals as part of
> their normal operation noticed slower operation on Itanium. Unlike
> Pascal which as "ERROR := CONTINUE" and "ERROR := MESSAGE" on all IO
> routines, BASIC gives you the single behavior of signalling and
> expects you to catch that will a handler (many people use
> LIB$SIG_TO_RET). So we added support to the RTL to allow you to set
> a "do not signal, but return instead" on a "per-call" basis and a
> "per-lun" basis. Subsequently (from reading the notes and comments),
> HPE India added a BASIC feature logical to change the default. So
> there must be at least one customer who found it difficult to modify
> their application or didn't have sources to the application. I did
> an eye-roll when I saw that edit to the RTL when I returned to VSI
> and reviewed the changes. I want to remove that logical for x86
> since the unwinding/signalling overhead on x86 is much smaller (not
> quite as small as Alpha, but much smaller than Itanium).
>
Thanks John, any help is greatly appreciated.
On this susbject, I find myself 110% in agreement with Steve's "break
backward compatibility" ideas.
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
More information about the Info-vax
mailing list