Hash: SHA1

Robert Simpson wrote:
> The purpose of a cache is to improve performance and responsiveness.  Any
> cache that uses all physical memory, forces all other apps to the paging
> file 

All current operating systems do this, using heuristics to determine how
much of each running application to leave in memory while using "spare"
memory for filesystem cache and dynamically changing allocation based on
demand.  Sometimes they mess up to the detriment of idle applications.
However that is not the bit I am talking about as it is not controlled
by flags when opening files and instead is part of the core operating
system code.  (You often see this issue when copying files larger than RAM).

What is under discussion is how the operating system is using the cache
that it does decide to allocate for SQLite.  If you tell it that a file
is sequential access then that means that read ahead is good and that
data already read can be discarded.  If you tell it that a file is
random access then read ahead is bad (it has the disk occupied when the
next random request comes in) and already read data should be kept.
SQLite does not know and should be leaving it up to the operating
system.  Your tests prove that when that is done on Vista, performance
of SQLite is better and other applications are less adversely affected.

> The real frustration is that this seems to be a rather obvious bug in Vista,
> and definitely not SQLite's responsibility. 

This is conflating two issues.  One is the tradeoff between RAM usage
for cache vs idle applications.  You can argue that is a bug, or more
accurately there are circumstances under which the tradeoff picks wrong
values, and is very hard to get right.  Example underlying details are
at http://blogs.technet.com/markrussinovich/archive/2008/02/04/2826167.aspx

The second issue is the performance differences when random access,
sequential and no flags are given while opening the file and the
resulting performance.  In this case a file is accessed mostly
sequentially but the random access flag is given.  Performance was worse
than letting the operating system use its own heuristics.  That is
hardly surprising or a bug.


Version: GnuPG v1.4.6 (GNU/Linux)

sqlite-users mailing list

Reply via email to