I am optimizing the PNG encoder for use in Flash SWF (but I am writing it in Haxe ).
I have so far managed to speed things up, mainly using read / write speed .
During the profiling of my code, I noticed that about 75% of the time is spent on one call to the built-in Flash compress () , which uses the zlib algorithm (which in turn uses DEFLATE).
I'm not too fussy about the compression ratio, but faster compression would be awesome. So, I was wondering if it's worth trying to implement zlib / DEFLATE. A small search led to the source of the C-Zlib implementation, but it doesn’t read the light exactly (or is easy to carry!).
Are there any simple zlib / DEFLATE implementations that I could use as a starting point? I would prefer not to wade through two specifications , especially since I do not know if the implementation running in AVM2 could even perform as fast as native Flash.
source
share