[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Array Register Analog in MCL?
- To: JCMA@ai.mit.edu (John C. Mallery)
- Subject: Re: Array Register Analog in MCL?
- From: slh@digitool.com (Steve Hain)
- Date: Sun, 14 May 1995 19:05:24 -0400
- Cc: info-mcl@digitool.com
- Sender: owner-info-mcl@digitool.com
I looked a little further into how to best optimize string references.
The following macro:
(defmacro fast-schar (string index)
`(locally
(declare (optimize (speed 3) (safety 0)))
(schar ,string ,index)))
will result in a call to the $SP-%SCHAR subprimitive, which does know
about fat (16-bit character) strings, but doesn't do bounds checking.
I think that's as fast as you can get without using LAP code. There is
also a $SP-%SET-SCHAR subprimitive, which you can get using the form:
(defmacro fast-set-schar (string index char)
`(locally
(declare (optimize (speed 3) (safety 0)))
(setf (schar ,string ,index) ,char)))
Hope these help; it would be interesting to see timing test results
from them.
- Steve Hain
Digitool, Inc.
______________________________________________________________________________
One Main Street 7th Floor Cambridge, MA 02142 USA
Internet: slh@digitool.com AppleLink: digitool
World Wide Web: http://www.digitool.com/
Tel: 617 441-5000 Fax: 617 576-7680