I'd say the performance of a local in-process cache can be comparable
with performance of OS cache only in one case: if your process is the
only process in the system and no other files are read from disk. In
all other (common) cases OS caches much larger set of data than is
used by SQLite and naturally it will be harder for OS to find your
data. Another concerns is if there is some other process
reading/writing a lot from disk it will evict all your data from cache
and you will have to read it from disk again. And one more
observation: if you want to rely on OS cache every time you need your
data you will have to make system call for reading. It's pretty
expensive operation by itself, plus kernel does a lot more
housekeeping operations than your application would do and kernel has
a lot of different code paths dedicated for different use cases. If
your application doesn't need all those use cases, those paths will
just slow it down without giving any benefit.

So considering all that I'd say keeping your own local cache is always
better than relying on something more general and intended for
everybody to use (not just you).


Pavel

On Fri, Nov 19, 2010 at 9:44 PM, Yang <teddyyyy...@gmail.com> wrote:
> I wonder why we need page cache, since we already have OS file cache.
>
> in other words, if we simply set OS cache to be very large, would it
> have the same effect as page cache?
>
> thanks
> Yang
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to