> With two threads, using only one connection (87.8 s) is actually slower than
> using two connections (66.7 s). The performance of using only one connection
> drastically increased until a thread count somewhere between 10 and 20 where
> it settles at about 11 seconds. Using one connection per thread reduces the
> elapsed time only from 66 to 55 seconds.

This is what one would expect.

> * The virtual machine has 2 CPU cores assigned. When using only one
> connection, only one core seems to be used. When using one connection per
> thread, both cores are used.

This is also to be expected.  

Because thread access to the sqlite engine is serialized by a mutex, the OS 
ought to set thread affinity for all operations running through the same mutex 
to the same CPU.  If you repeated the test using two connections only, and 
spreading your threads amongst connections, you ought to be able to get about 5 
or 6 seconds with 10 to 20 threads per connection.





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

Reply via email to