Subject: Re: amap_extend does unnecessary malloc/memcpy.
To: enami tsugutomo <enami@but-b.or.jp>
From: Bang Jun-Young <bjy@mogua.org>
List: tech-kern
Date: 11/18/2001 03:21:20
On Sat, Nov 17, 2001 at 12:12:22AM +0900, enami tsugutomo wrote:
> Hi.
> 
> I recently found amap_extend does unnecessary malloc and memcpy.  Here
> is a chagnes to allocate optimal size when extending amap with
> assuming some malloc implementation and sizeof(int) and
> sizeof(pointer).
> 
> Do you see any problem with this change?

No, not yet. :)

> 
> Here is some benchmark; a time to build my kernel with
> normal kernel:
>       382.95 real       303.87 user        39.98 sys
>       382.50 real       304.45 user        40.32 sys
>       382.52 real       303.79 user        39.78 sys
> patched kernel:
>       370.48 real       298.90 user        33.52 sys
>       371.88 real       297.05 user        34.53 sys
>       370.66 real       299.46 user        32.58 sys

Another result with building GENERIC kernel on my machine:

Before:
383.38s user  28.98s system  76% cpu  8:57.76 total
After:
378.96s user  22.25s system  76% cpu  8:47.76 total

10 seconds was reduced - quite cool. :)

Jun-Young

-- 
Bang Jun-Young <bjy@mogua.org>