From: Sam S. <sd...@gn...> - 2004-09-03 13:49:54
|
> * Hoehle, Joerg-Cyril <Wbret-Plevy.Ubruyr@g-flfgrzf.pbz> [2004-09-03 10:32:25 +0200]: > > Sam Steingold asked: >>well, whatever the means, I want ZLIB:COMPRESS and ZLIB:UNCOMPRESS in >>the new ZLIB module to be as efficient as possible. > > Well, that means writing a module instead of using the FFI. > With the FFI, there will always the overhead of parsing the internal > c-type description of the foreign function. I thought other lisps could compile foreign calls to something non-consing. > In particular, if you want compress/uncompress as part of a "core" > CLISP and possibly take advantage of them in other parts of core CLISP > (e.g. transparent compressed streams), then the FFI is *not* the way > to go. of course. making i/o pluggable (e.g., letting OPEN handle compressed streams and SSL sockets) would take a rewrite of stream.d anyway. >>if they were written in C using modprep.lisp they would not >>cons at all. >>is it possible to make them non-consing while still using FFI? > > d) Even with a module, what would you do with the in and out buffers, > do they count as consing? Would you always stack-allocate? Would you both COMPRESS and UNCOMPRESS should take both input and output buffers from the outside. > use a fill-pointer to resize the output buffer to the actual size > (trading array-copying time with wasted buffer space)? yes. -- Sam Steingold (http://www.podval.org/~sds) running w2k <http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/> <http://www.mideasttruth.com/> <http://www.honestreporting.com> The world will end in 5 minutes. Please log out. |