[cl-pdf-devel] cl-pdf with salza

Dmitriy Ivanov divanov at aha.ru
Mon Apr 11 18:21:13 UTC 2005


Hello Marc,

|> The type sys:int32 corresponds (singned-byte 32), which IMHO less
| convenient
|> then (unsingned-byte 32). For example, MD5 widely uses modulo-2^32
| addition.
|> In what way sys:int32 can help to implement this?
|
| Looks like you have found how to use it ;-)
| (refering to your announce in lisp-hug)

Modulo-2^32 addition has turned out not to be a problem. The really missed
operations are mod and logical-right-shift (not propagating the sign bit).

I have managed to improve SALZA performance on LW 4.4 slightly using sys:int32
arithmetic. See the bunch of the changed files attached. I have had to
change the order of source files in the system definition - look at my
defsys.lisp.

Below is the excerpt from the simple test case.

(setq size 100000
      src (make-array size :element-type '(unsigned-byte 8)))
(dotimes (i size) (setf (aref src i) (random 256))))

;#-lw-int32
(extended-time (progn (setq v1 (zlib:compress-sequence src)) (length v1)))
;user time    =      0.421
;system time  =      0.000
;Elapsed time =   0:00:00
;Allocation   = 10759576 bytes standard / 2057 bytes conses
;0 Page faults

;#+lw-int32
(extended-time (progn (setq v2 (zlib:compress-sequence src)) (length v2)))
;user time    =      0.234
;system time  =      0.000
;Elapsed time =   0:00:00
;Allocation   = 4200024 bytes standard / 4499 bytes conses
;0 Page faults

Please test.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: salza.zip
Type: application/x-zip-compressed
Size: 13640 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20050411/5a55ed02/attachment.bin>


More information about the cl-pdf-devel mailing list