On 08/17/2010 10:09 AM, Tim Bird wrote:
> Well, page faults are always inherently slower than reads, 

It's embarrassing, but I have to correct myself here.
An mmap and an access of a single page will likely take
longer than a corresponding read.  But accessing multiple
pages can amortize the cost of setting up the page tables
for the mmap, and avoids a data copy for each read, which
the read syscall incurs.  Whether mmap()/page-fault or read()
is faster depends on a number of factors, but mmap often
wins.
 -- Tim

=============================
Tim Bird
Architecture Group Chair, CE Linux Forum
Senior Staff Engineer, Sony Network Entertainment
=============================

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to