Re: [PATCH] replace kmem_cache_alloc with kmem_cache_zalloc to remove some following zero initializations.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

On 7/13/07, Kirill Korotaev <dev@sw.ru> wrote:
But why?

My reason to think it's better and faster is that:
1. the code will be shorter if it calls zalloc and then removes the
NULL and zero initilization;
2. in the assembly code objdumped, many mov operations reduced, such as:
    movl $0,0x40(%ebp)
    ...
    this style of zero initialization occupies 7 bytes per line
(i386), and then multiply 7 lines,

3. the only change is that calls to kmem_cache_zalloc other than
kmem_cache_alloc, it's just an extra memset is called, as we all know
the memset implimentation is string operation, that's rather fast.



-- 
Denis Cheng
Linux Application Developer

"One of my most productive days was throwing away 1000 lines of code."
 - Ken Thompson.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] replace kmem_cache_alloc with kmem_cache_zallo ..., rae l, (Fri Jul 13, 1:38 am)