[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] seq: speed up the common case by 25x
From: |
Pádraig Brady |
Subject: |
Re: [PATCH] seq: speed up the common case by 25x |
Date: |
Fri, 01 Apr 2011 10:49:11 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 01/04/11 10:20, Jim Meyering wrote:
> Pádraig Brady wrote:
>> seq: speed up the common case by 560%
>>
>> * seq.c (print_range): Print a range of numbers
>> without using if statements for speed.
>> (print_long_range): Print a range of numbers
>> using the unix paradigm of using other utils
>> that do it better.
>
> Great idea.
> I get this:
>
> $ env time ./seq 10000000 > /dev/null
> 0.50user 0.06system 0:00.20elapsed 273%CPU (0avgtext+0avgdata
> 4800maxresident)k
> ...
>
> Compare with the old version's time:
>
> 5.06user 0.00system 0:05.08elapsed 99%CPU (0avgtext+0avgdata
> 2608maxresident)k
>
> So here I benefit from parallelism, and end up with not just 560% (5.6x)
> but a 25x(!) speed-up (on an i7-970).
My April fool's joke has spectacularly backfired.