On 29 Sep 2009, at 10:29pm, Matthew Tippett wrote:

> If there is anyone who is interested in assisting in improving the
> quality/value/functional interest of the benchmarks, then please
> advise.

In SQLite, when you know you are making many changes and don't need to  
consult the data until you're finished, you surround the changes with  
BEGIN TRANSACTION and END TRANSACTION.  This makes them into one big  
update rather than lots of little ones, and it means that disk gets  
updated just once (handwave here) rather than after each command.   
Naturally, this is hugely faster.  No way should 2500 inserts in  
SQLite take 14 minutes.

So much faster that, as Pavel noted upthread, it's suspiciously like  
what you're seeing in the result for KVM.  This suggests that KVM is  
not really writing results to disk immediately.  Putting those INSERTs  
into one transaction could make Ubuntu 9.10 (not KVM) as fast or  
faster than the result you're getting for KVM.  Sorry, I have no Linux  
to test it on.

You could modify the sqlite test to reflect this.  You could perhaps  
turn sqlite-2500-insertions.txt into 50 transactions, with BEGIN  
TRANSACTION and END TRANSACTION around each 50 INSERT commands.  Or  
you could have two tests: make two copies of sqlite-2500- 
insertions.txt, leave one as it is and put BEGIN TRANSACTION and END  
TRANSACTION at the beginning and end of the other.  This would test  
both 2500 individual INSERT commands and one transaction of 2500  
INSERTs, testing SQLite as both kinds of application would need to use  
it.

I know nothing about KVM but I assume that it's operating correctly  
here: since the entire machine is virtualised it doesn't matter that  
it's not really writing to real disk.

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

Reply via email to