Hi,

On Mon, 21 Nov 2005 10:56:41 -0500 (EST)
Shane Baker <[EMAIL PROTECTED]> wrote:

> I just need to figure out why my performance is about 30x slower than what
> others are reporting when using the library in similar ways.

Are you using sqlite on windows or MacOS X?

As I tested, sqlite performs 10 write transactions per sec on
windows and MacOS X. On Linux, sqlite performs up to 300 write
transactions per sec if HDD cache is enabled. However, when HDD cache
is disabled (/sbin/hdparm -W0 /dev/hda etc.), it drops to 10
transactions per sec.

To ensure ACID compliance, sqlite seems to be using FlushFileBuffers() on
windows, F_FULLFSYNC fcntl() on MacOS X, and fsync() on other unixes.
FlushFileBuffers and F_FULLFSYNC fcntl() flush HDD write-back
cache, and they are very slow. However, many implementations of fsync()
don't flush HDD cache (they flush OScache only). It's very fast, but
dangerous (not ACID compliant) if HDD cache has no battery backup.
(So i'm using sqlite on Linux with HDD cache off.)

Reply via email to