Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!spool.mu.edu!usenet.eel.ufl.edu!news.mathworks.com!uunet!in1.uu.net!nntp.cadence.com!news
From: Nancy Aten <nancya>
Subject: VW2 #do:,#at: - array bounds checking? Opinions requested.
Content-Type: text/plain; charset=us-ascii
Message-ID: <DE1yrs.6s8@Cadence.COM>
To: nancya@cadence.com
Sender: news@Cadence.COM
Content-Transfer-Encoding: 7bit
Organization: Cadence Design System, Inc.
Mime-Version: 1.0
Date: Tue, 29 Aug 1995 03:23:51 GMT
X-Mailer: Mozilla 1.1N (X11; I; SunOS 4.1.3_U1 sun4m)
X-Url: news:comp.lang.smalltalk
Lines: 25

Some of our code spends unjustified amounts of time inside #at:, 
mostly as sent from within #do: methods on arrays. In VW2, 
SequenceableCollection implements #do: as follows.
 
do: aBlock
   1 to: self size do: [:i | aBlock value: (self at: i)].
 
The #at: method uses a primitive, which, ParcPlace tells me, does 
array bounds checking. ParcPlace says because of reasons of memory 
safety, they won't provide a non-bounds-checking version.
 
I won't try to argue here about allowing applications to choose the 
risk in performance-critical areas of tested code for #at:.
 
I'm merely asking for appropriate #do: methods to use a faster 
non-bounds-checking primitive, which would apparently be perfectly 
memory-safe in this usage (since #do: is only walking valid indices). 
 
I'm trying to gather support to encourage ParcPlace to provide this 
presumably highly valuable and safe performance improvement. Please
help me with support, or by educating me on why this request is 
unreasonable. Thanks very much!

Nancy Aten

