lkml.org 
[lkml]   [2008]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] mmaped copy too slow?
KOSAKI Motohiro wrote:
> Hi
>
> at one point, I found the large file copy speed was different depending on
> the copy method.
>
> I compared below method
> - read(2) and write(2).
> - mmap(2) x2 and memcpy.
> - mmap(2) and write(2).
>
> in addition, effect of fadvice(2) and madvice(2) is checked.
>
> to a strange thing,
> - most faster method is read + write + fadvice.
> - worst method is mmap + memcpy.

One thing you could also try is to pass MAP_POPULATE to mmap so that the
page tables are filled in at the time of the mmap, avoiding a lot of
page faults later.

Just my 2 cents,

--
Paulo Marques - www.grupopie.com

"All I ask is a chance to prove that money can't make me happy."


\
 
 \ /
  Last update: 2008-01-15 13:49    [W:0.107 / U:0.120 seconds]
©2003-2014 Jasper Spaans. Advertise on this site