public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Joakim Tjernlund" <Joakim.Tjernlund@lumentis.se>
To: "David Woodhouse" <dwmw2@infradead.org>
Cc: <jffs-dev@axis.com>, <linux-mtd@lists.infradead.org>
Subject: crc32() optimization
Date: Sun, 10 Nov 2002 16:28:00 +0100	[thread overview]
Message-ID: <002301c288cd$c11a6180$0200a8c0@telia.com> (raw)
In-Reply-To: 24987.1036797874@passion.cambridge.redhat.com

Hi David

This patch improves my scan time with 22%( from 2.39 to 1.86 seconds).
Maybe you want to include it in the 2.4 branch.

I will put this in my next backport of the crc32 stuff from 2.5.

          Jocke

Index: fs/jffs2/crc32.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/crc32.h,v
retrieving revision 1.3
diff -u -b -r1.3 crc32.h
--- fs/jffs2/crc32.h    26 Feb 2001 14:44:37 -0000      1.3
+++ fs/jffs2/crc32.h    10 Nov 2002 15:25:11 -0000
@@ -13,7 +13,16 @@
 crc32(__u32 val, const void *ss, int len)
 {
        const unsigned char *s = ss;
-        while (--len >= 0)
+        while (len >= 6){
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
+         len -= 6;
+        }
+        while (len--)
                 val = crc32_table[(val ^ *s++) & 0xff] ^ (val >> 8);
         return val;
 }

       reply	other threads:[~2002-11-10 14:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F122OgRGkQ6mBySsxVY00000854@hotmail.com>
     [not found] ` <24987.1036797874@passion.cambridge.redhat.com>
2002-11-10 15:28   ` Joakim Tjernlund [this message]
2002-11-10 18:43     ` crc32() optimization Marc Singer
2002-11-10 19:25       ` Wolfgang Denk
2002-11-10 20:05         ` Joakim Tjernlund
2002-11-10 21:00           ` Wolfgang Denk
2002-11-10 21:22             ` Joakim Tjernlund
2002-11-10 22:35               ` Joakim Tjernlund
2002-11-10 22:41                 ` Wolfgang Denk
2002-11-10 23:00                   ` Joakim Tjernlund
2002-11-10 23:56                     ` Eric W. Biederman
2002-11-11  1:31             ` Marc Singer
2002-11-11  1:37               ` Wolfgang Denk
2002-11-11  4:42                 ` Marc Singer
2002-11-25 15:55                   ` Herman Oosthuysen
2002-11-25 16:12                     ` Joakim Tjernlund
2002-11-11  0:50         ` Marc Singer
2002-11-10 20:04       ` Joakim Tjernlund

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='002301c288cd$c11a6180$0200a8c0@telia.com' \
    --to=joakim.tjernlund@lumentis.se \
    --cc=dwmw2@infradead.org \
    --cc=jffs-dev@axis.com \
    --cc=linux-mtd@lists.infradead.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