Eric,
 
Thanks for the pragma tip which improves the speed significantly. The single 
insert is under 4 ms now.
 
The only published sqlite performance i found 
is http://www.sqlite.org/speed.html, which is too old. However, assuming the 
performance still holds up, the windows speed seems 10 times of linux, with and 
without synchronization (see section "Test 1: 1000 Inserts" in the linked 
page). 
I wonder if there is a similar benchmark test for windows.

FLX
--- On Tue, 11/25/08, Eric Minbiole <[EMAIL PROTECTED]> wrote:

From: Eric Minbiole <[EMAIL PROTECTED]>
Subject: Re: [sqlite] sqlite 3.6.5 slow on windows
To: [EMAIL PROTECTED], "General Discussion of SQLite Database" 
<sqlite-users@sqlite.org>
Date: Tuesday, November 25, 2008, 6:05 PM

> Here is a typical outputs from the program running in debug mode:

Debug builds can be substantially slower.  I would expect at least some
performance improvement with a release build (optimizations on).


> Notice my constraint is these SQL statements must run one by one, not
within a transaction.

Alas, this will dramatically reduce write performance.  Since each insert
statement will now require an explicit disk flush, it will be very slow.  Is
there *really* no way to group multiple writes together?  As you've likely
read elsewhere, doing so can provide orders of magnitude performance
improvements-- well worth the effort to reorganize your architecture a bit.


> 1) are these expected performance on windows?
> 2) if not, what can be done to improve it?

If you really must run the statements individually, you have a few (less than
perfect) alternatives:

- Turn off synchronous writes ("pragma synchronous = OFF").  Though
this will dramatically improve your insert performance, you will be running
without any safety net: If the application crashes or exits during a write, your
database may become (permanently) corrupted.

- The compiler optimizations (above) will likely help somewhat, though not
terribly much.

- A faster (higher RPM) hard drive will help somewhat.


~Eric




      
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to