> However, I have a question. Decoding attachments seems to take a long
> time.
> Decoding a base64-encoded attachment of 10 MB takes 17 sec.

On which machine? (cpu, mainboard, amount of free RAM, operating system...)
If it's new/rather new machine, such result is far below expectations -
I get 20 sec on old P120 with 32MB RAM and Win95.

> Is there a way
> to make the decoding work faster? I have about the same testresult on the
> beta and the older version of MimeDec.

There's many ways to make it faster. First, do not use TMemoryStream as
decoded attachment storage *unless* you set it's size so TMemoryStream won't
need to reallocate his memory. Second, you should use larger input buffer
(not that 4kbyte one), or change decoding logic so you could use memory-
mapped file. Third, do not use OnPartLine to store data - set DestStream
and leave OnPartLine unassigned (you'll save one jump into and out of
the handler, possibly dirtying less processor's L1/L2 cache).
Fourth, use TMemoryStream (or some kind of TBufferedWriteStream) as decoded
data storage (but remember about the first note above). 

Fifth - discard these fancy progressbars (and progressbar updating code) ;)

Piotr "Hellrayzer" Dalek

Sa niesamowite, zobaczysz... ;-) >>> link http://link.interia.pl/f18b9

To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to