linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Joakim Tjernlund <joakim.tjernlund@lumentis.se>
Cc: linux-kernel@vger.kernel.org, Etienne Lorrain <etienne_lorrain@yahoo.fr>
Subject: Re: [PATCH RFC] 2.5.73 zlib #2 codefold
Date: Wed, 2 Jul 2003 18:59:00 +0200	[thread overview]
Message-ID: <20030702165900.GB12520@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <IGEFJKJNHJDCBKALBJLLIEODFNAA.joakim.tjernlund@lumentis.se>

On Wed, 2 July 2003 10:46:05 +0200, Joakim Tjernlund wrote:
> 
> > This patch folds three calls to memmove_update into one.  This is the
> > same structure that was in the 1.1.3 version of the zlib as well.  The
> > change towards 1.1.4 was mixed with a real bugfix, so it slipped
> > through my brain.
> >
> [SNIP]
> 
> Looks fine to me.
> 
> Here is another one in gen_bitlen():
> Replace:
>   for (bits = 0; bits <= MAX_BITS; bits++) s->bl_count[bits] = 0;
> with:
>   memset(&s->bl_count[0], 0, MAX_BITS * sizeof(s->bl_count[0]));
> 
> Also the following could should be replaced(in defutil.h):
> /* ===========================================================================
>  * Reverse the first len bits of a code, using straightforward code (a faster
>  * method would use a table)
>  * IN assertion: 1 <= len <= 15
>  */
> static inline unsigned bi_reverse(unsigned code, /* the value to invert */
> 				  int len)       /* its bit length */
> {
>     register unsigned res = 0;
>     do {
>         res |= code & 1;
>         code >>= 1, res <<= 1;
>     } while (--len > 0);
>     return res >> 1;
> }
> 
> Anybody have a table version handy?

Onto my unwritten todo list with them.  The next lazy afternoon will
come for sure.

Etiennes code sounds promising as well.  Will have a closer look one
of those afternoons.  If it does fit the description, it might be a
good alternative for those platforms it happens to run on.

On a whole, I think it is better to leave most changes out of
mainline until 2.7 is opened.  At least, unless someone comes up with
an extensive test suite for correctness, throughput and interactivity.
Volunteers? ;)

Jörn

-- 
Data dominates. If you've chosen the right data structures and organized
things well, the algorithms will almost always be self-evident. Data
structures, not algorithms, are central to programming.
-- Rob Pike

      reply	other threads:[~2003-07-02 16:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01 15:45 [PATCH RFC] 2.5.73 zlib #1 memmove Jörn Engel
2003-07-01 16:16 ` [PATCH RFC] 2.5.73 zlib #2 codefold Jörn Engel
2003-07-02  8:46   ` Joakim Tjernlund
2003-07-02 16:59     ` Jörn Engel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030702165900.GB12520@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=etienne_lorrain@yahoo.fr \
    --cc=joakim.tjernlund@lumentis.se \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).