public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hazelton <dhazelton@enter.net>
To: Adrian Bunk <bunk@stusta.de>
Cc: Nitin Gupta <nitingupta910@gmail.com>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-mm-cc@laptop.org,
	linuxcompressed-devel@lists.sourceforge.net,
	Andrew Morton <akpm@linux-foundation.org>,
	Richard Purdie <richard@openedhand.com>,
	Bret Towe <magnade@gmail.com>,
	Satyam Sharma <satyam.sharma@gmail.com>
Subject: Re: [RFC] LZO de/compression support - take 6
Date: Mon, 28 May 2007 11:49:55 -0400	[thread overview]
Message-ID: <200705281149.55759.dhazelton@enter.net> (raw)
In-Reply-To: <20070528153055.GN3899@stusta.de>

On Monday 28 May 2007 11:30:55 Adrian Bunk wrote:
> On Mon, May 28, 2007 at 08:10:31PM +0530, Nitin Gupta wrote:
> > Hi,
> >
> > Attached is tester code used for testing.
> > (developed by Daniel Hazelton -- modified slightly to now use 'take 6'
> > version for 'TinyLZO')
> >
> > Cheers,
> > Nitin
> >
> > On 5/28/07, Nitin Gupta <nitingupta910@gmail.com> wrote:
> >> (Using tester program from Daniel)
> >>
> >> Following compares this kernel port ('take 6') vs original miniLZO code:
> >>
> >> 'TinyLZO' refers to this kernel port.
> >>
> >> 10000 run averages:
> >> 'Tiny LZO':
> >>        Combined: 61.2223 usec
> >>        Compression: 41.8412 usec
> >>        Decompression: 19.3811 usec
> >> 'miniLZO':
> >>        Combined: 66.0444 usec
> >>        Compression: 46.6323 usec
> >>        Decompression: 19.4121 usec
> >>
> >> Result:
> >> Overall: TinyLZO is 7.3% faster
> >> Compressor: TinyLZO is 10.2% faster
> >> Decompressor: TinyLZO is 0.15% faster
>
> So your the compressor of your version runs 10.2% faster than the
> original version.
>
> That's a huge difference.
>
> Why exactly is it that much faster?

All I've done is write the code used for testing the compressor in userspace, 
but I think it might have something to do with the NOP that cpu_to_le16() is 
on LE systems (the original has an open-coded byte-swap and I don't think it 
ever really gets passed) and the removal of a lot of un-needed casts. 
(version 5 of the code re-introduced one of the macro's that had a lot of 
casts and it showed a drastic slow-down). Anyway, I'm going to get back into 
my testbed and see about actually making a lot of the stuff that is currently 
just a NOP (I made exceedingly minor changes to the files to get the working 
in userspace - one of the changes was to define the kernel-specific macros's 
likely(), unlikely(), noinline and cpu_to_le16() to be NOP's.) into 
functional code. That set of changes may affect the performance and bring it 
closer to the original or it may not.

And the testbed code is open - I guess I should stick the GPL headers in it, 
even though it isn't likely to see much use outside a very small circle. If 
*anyone* is skeptical about the numbers, feel free to use the testbed 
yourself. (It currently only works as intended on LE systems, however) Just 
untar the source into a directory, run make and the run 'tester.pl' to 
actually perform the test runs and gather the numbers. There is no overhead 
included in the numbers - they come directly from running gettimeofday() 
before and after the calls to the respective functions (well, a bit of magic 
is done to make the numbers have meaning).

DRH

PS: the variable '$RUNS' in tester.pl determines how many times the script 
loops each program to generate the numbers. I'm currently using 10000 runs to 
generate the average timings, but if you feel that is too large or too small 
a sample set, go ahead and change it.

  parent reply	other threads:[~2007-05-28 15:50 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-28 14:34 [RFC] LZO de/compression support - take 6 Nitin Gupta
2007-05-28 14:40 ` Nitin Gupta
2007-05-28 14:49   ` Daniel Hazelton
2007-05-28 15:06     ` Nitin Gupta
2007-05-28 15:43       ` Adrian Bunk
2007-05-28 16:03         ` Nitin Gupta
2007-05-28 17:11           ` Adrian Bunk
2007-05-28 19:59             ` Daniel Hazelton
2007-05-28 20:18             ` Daniel Hazelton
2007-05-28 20:52               ` Daniel Hazelton
2007-05-29  5:55             ` Nitin Gupta
2007-05-29  8:08             ` Michael-Luke Jones
2007-05-29 11:40               ` Adrian Bunk
2007-05-29 12:03                 ` Nitin Gupta
2007-05-29 13:13                   ` Daniel Hazelton
2007-05-29 21:10             ` Jan Engelhardt
2007-05-29 21:26               ` Adrian Bunk
2007-05-30  5:31                 ` Nitin Gupta
2007-05-30 13:56                   ` Johannes Stezenbach
2007-05-30 14:24                     ` Satyam Sharma
2007-05-28 15:30   ` Adrian Bunk
2007-05-28 15:47     ` Nitin Gupta
2007-05-28 15:55       ` Daniel Hazelton
2007-05-28 17:01         ` Adrian Bunk
2007-05-28 19:51           ` Daniel Hazelton
2007-05-28 15:49     ` Daniel Hazelton [this message]
2007-05-28 22:57   ` Bret Towe
2007-05-29  5:48     ` Nitin Gupta
2007-05-29 13:09       ` Daniel Hazelton
2007-05-28 22:53 ` Bret Towe
2007-05-28 22:58   ` Bret Towe
2007-05-29  5:58   ` Nitin Gupta
2007-05-29 20:14     ` Daniel Hazelton
2007-05-29 20:33       ` Daniel Hazelton
2007-05-29 21:48         ` Daniel Hazelton
2007-05-29 23:32     ` Daniel Hazelton
2007-05-30  5:19       ` Nitin Gupta
2007-05-29  8:17 ` Makefile question (was [RFC] LZO de/compression support - take 6) Michael-Luke Jones
2007-05-29 10:41   ` Satyam Sharma
2007-05-29 10:51     ` Michael-Luke Jones
2007-05-29 11:27       ` Satyam Sharma
2007-05-29 13:33         ` JFFS2 using 'private' zlib header " Michael-Luke Jones
2007-05-29 13:43           ` Daniel Hazelton
2007-05-29 15:15             ` Satyam Sharma
2007-05-29 16:20               ` Daniel Hazelton
2007-05-30  5:31               ` Mark Adler
2007-05-30 13:05                 ` Daniel Hazelton
2007-05-30 13:30                 ` Satyam Sharma
2007-05-30 23:02                   ` Mark Adler
2007-05-30 23:26                     ` Daniel Hazelton
2007-06-01  3:06                     ` Daniel Hazelton
2007-06-01 17:24                       ` Satyam Sharma
2007-05-30 13:41               ` Artem Bityutskiy
2007-05-30 15:46                 ` Artem Bityutskiy
2007-05-30 16:12                   ` Satyam Sharma
2007-05-30 16:43                     ` Artem Bityutskiy
2007-05-29 20:48 ` [RFC] LZO de/compression support - take 6 Jan Engelhardt
2007-05-30  5:54   ` Nitin Gupta
2007-05-30  8:31     ` Jan Engelhardt
2007-05-30 10:47       ` Nitin Gupta
2007-05-31 12:34 ` Nitin Gupta
2007-05-31 18:21   ` Satyam Sharma

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=200705281149.55759.dhazelton@enter.net \
    --to=dhazelton@enter.net \
    --cc=akpm@linux-foundation.org \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm-cc@laptop.org \
    --cc=linuxcompressed-devel@lists.sourceforge.net \
    --cc=magnade@gmail.com \
    --cc=nitingupta910@gmail.com \
    --cc=richard@openedhand.com \
    --cc=satyam.sharma@gmail.com \
    /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