From: Bob D. <bd...@si...> - 2006-01-23 15:00:22
|
Hi, Patch looks good except I would prefer compression be optional at run time as well. If we had something like: rpdf_enable_compression(struct rpdf *pdf, gboolean setting) And have a flag in the rpdf struct. =20 We could then have an output parameter in rlib to set it on. Thanks! - Bob On Sun, 2006-01-22 at 15:26 +0100, Zoltan Boszormenyi wrote: > Hi, >=20 > Zoltan Boszormenyi =C3=ADrta: >=20 > > Now it's getting embarrassing... Fix again. Use this patch instead of= =20 > > the previous. > > > > Zoltan Boszormenyi =C3=ADrta: > > > >> Another fix. :-( This time incremental against the previous one. > >> - Don't free something I didn't allocated. > >> - Some white space fixes. > > > > > > > > Also check the return value of deflateEnd(), too. > > > > Best regards, > > Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi >=20 >=20 > here's a slightly cheaper version of the patch, as deflateInit() > is done only in rpdf_new() and deflateEnd() is done in rpdf_free(). > Instead, deflateReset() is used in rpdf_add_page_content_compressed(). >=20 > $ time for i in `seq 1 1000` ; do ./test >test1.pdf ; done >=20 > real 0m2.359s > user 0m1.041s > sys 0m1.311s >=20 > Now the 1000 iterations took only 201 msecs more than without compressi= on. > Also, should any error happen during compression, the next content won'= t be > compressed. It should only happen under OOM condition and I guess it's=20 > very unlikely. >=20 > Best regards, > Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi >=20 |