RE: Performance improvements to this code...
Thanks to all for the assistance. I'll try this and other suggestions. dey -----Original Message----- From: Wade Humeniuk [mailto:whumeniu@telus.net] Sent: Monday, October 17, 2005 7:57 PM To: Young, David Cc: 'lisp-hug@lispworks.com' Subject: Re: Performance improvements to this code... Young, David wrote: >Hi. We've done a fair bit of profiling to our system and have eliminated all >known major hotspots. We're now looking at other possibilities, and this >section of code might be a candidate: > >(defmethod stream:stream-read-byte ((strm binary-input-stream)) > (declare (optimize speed)) > (with-slots ((buf buffer) > (i index) > (size bufsiz)) strm > (declare (type fixnum i size) > (type (array (unsigned-byte 8)) buf)) > (if (= i size) > :eof > (aref buf (the fixnum (1- (the fixnum (incf i)))))))) > > > Try this, the disaasembly is much smaller, (defmethod stream:stream-read-byte ((strm binary-input-stream)) (declare (optimize (speed 3) (safety 0) (debug 0) (hcl:fixnum-safety 0))) (with-slots ((buf buffer) (i index) (size bufsiz)) strm (declare (type fixnum i size) (type (simple-array (unsigned-byte 8) (*)) buf)) (if (= i size) :eof (aref buf (1- (incf i)))))) This email message is for the sole use of the intended recipients(s) and may contain confidential and privileged information of Bloodhound Software, Inc.. Any unauthorized review, use, disclosure is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.