On Friday, 27 December, 2019 10:29, Cecil Westerhof <cldwester...@gmail.com> 
wrote:

>Op vr 27 dec. 2019 om 17:01 schreef Simon Slavin <slav...@bigfraud.org>:

>> On 27 Dec 2019, at 3:06pm, Cecil Westerhof <cldwester...@gmail.com> wrote:

>>> My applications only use one thread (for the db stuff). Would it be a
>>> good idea to switch to single-thread mode, or does that not give a real
>>> performance improvement?

>>> On a desktop computer, or a mobile phone, the increase in speed is not
>>> large.  Maybe a few percent.  If your application is already fast
>>> enough.

>> to please your users, I would not do the switching.

>OK, thanks. I will not bother about that then. ;-)

There are, of course, other considerations.  For example, I wrote a program 
which runs initial connection packets against some firewall rules.  The current 
database size is ~11 million initial packets and ~2000 rules.  Basically, 
running the entire thing is one (admittedly large and complex) SQL statement.

The initial total runtime was about 25 minutes (includes a couple of other 
sumarization steps -- about 22 minutes spent just running the ruleset).  After 
redesigning the query the time to run it dropped to 23 seconds for a total 
elapsed time of 2 minutes.

Setting "SINGLE THREADED" mode *increased* the elapsed time to 4 minutes.  
(Perhaps it disables some of the internal multithreaded sorters -- I don't 
know).  

Setting "MUTITHREAD" shaved an additional 50 nanoseconds off the runtime.

The moral of the story is that it is (in this case) not worth changing the 
default mode of SERIALIZED and that it may not have the result you intend.

-- 
The fact that there's a Highway to Hell but only a Stairway to Heaven says a 
lot about anticipated traffic volume. 



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

Reply via email to