From ... From: Erik Naggum Subject: Re: Performance tuning Date: 2000/12/05 Message-ID: <3185044115971786@naggum.net>#1/1 X-Deja-AN: 701551388 References: <3184953833736032@naggum.net> <3A2C7C38.4F68956A@fisec.com> <3185025504930095@naggum.net> <90jju3$44s$1@reader1.fr.uu.net> mail-copies-to: never Content-Type: text/plain; charset=us-ascii X-Complaints-To: newsmaster@eunet.no X-Trace: oslo-nntp.eunet.no 976058252 27017 195.0.192.66 (5 Dec 2000 23:17:32 GMT) Organization: Naggum Software; vox: +47 800 35477; gsm: +47 93 256 360; fax: +47 93 270 868; http://naggum.no; http://naggum.net User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Mime-Version: 1.0 NNTP-Posting-Date: 5 Dec 2000 23:17:32 GMT Newsgroups: comp.lang.lisp * "Marc Battyani" | Why did you not use LDB to access parts of the bignums? Mainly because it failed to inline. | Direct memory access must be faster, but are there other reasons? Not really. LDB should have been able to do this, but it gets somewhat specialized before it can be optimized really heavily. | About SETF LDB the HS says : "setf may be used with ldb to modify a | byte within the integer that is stored in a given place. The order of | evaluation, when an ldb form is supplied to setf, is exactly | left-to-right. The effect is to perform a dpb operation and then store | the result back into the place. " Unfortunately, this "place" is not the bignum, but the binding that holds the bignum. I have never seen a dbp on a bignum return a bignum eq to the previous value, but I expected just that when I first wanted to use dpb on bignums. | I wonder why there is no destructive version of SETF LDB that would modify | the given integer? | This would certainly be useful. I agree that this would be very useful with bignums, but I have not seen much significant optimization of bignum arithmetic, and I might understand why: This implementation of MD5 is the first time I have needed to hack bignums fast. I guess it would help if bignums were used a lot and that performance matters more to more Common Lisp users -- optimizing bignum arithmetic is hard work and needs assembly code to be _really_ efficient. #:Erik -- "When you are having a bad day and it seems like everybody is trying to piss you off, remember that it takes 42 muscles to produce a frown, but only 4 muscles to work the trigger of a good sniper rifle." -- Unknown