Re: [PATCH] [48/48] Suspend2 2.1.9.8 for 2.6.12: 624-filewriter.patch

Pavel Machek
2005-07-09T12:10:55Z

Hi!

> +/*
> + * sacrifice some compression quality in favour of compression speed.
> + * (roughly 1-2% worse compression for large blocks and
> + * 9-10% for small, redundant, blocks and >>20% better speed in both cases)
> + * In short: enable this for binary data, disable this for text data.
> + */
> +#define ULTRA_FAST 1
> +
> +#define STRICT_ALIGN 0
> +#define USE_MEMCPY 1
> +#define INIT_HTAB 0

Ugly, ugly, ugly. Pick one set of options and use them.

> +/*
> + * don't play with this unless you benchmark!
> + * decompression is not dependent on the hash function
> + * the hashing function might seem strange, just believe me
> + * it works ;)
> + */
> +#define FRST(p) (((p[0]) << 8) + p[1])
> +#define NEXT(v,p) (((v) << 8) + p[2])

Dnt wrt mcr nms lk ths!

> + if (ctx->first_call) {
> + ctx->first_call = 0;
> + }
> +#if INIT_HTAB
> +# if USE_MEMCPY
> + memset (htab, 0, sizeof (htab));
> +# else
> + for (hslot = htab; hslot < htab + HSIZE; hslot++)
> + *hslot++ = ip;
> +# endif
> +#endif

Eh? Use_memcpy and then it memsets?

BTW if it is "contributed code", you may want original contributor to
push it, so that you don't have to do all the lindenting/cleaning/etc
yourself.

Pavel
--
teflon -- maybe it is a trademark, but it should not be.