I think however our lower boundary is 0.05 seconds since we do commits
after insert events is called, which is a disk write. Now we could avoid
that by first returning the values to the user then commiting... It will
save noticeable time.

I tried setting journal_mode to WAL
Speed improvement from 1.5 to 0.5 - 1.0

The WAL journaling mode uses a write-ahead log instead of a rollback
journal to implement transactions. The WAL journaling mode is
persistent; after being set it stays in effect across multiple database
connections and after closing and reopening the database. A database in
WAL journaling mode can only be accessed by SQLite version 3.7.0 or

More info can be found here: http://www.sqlite.org/wal.html

Improve insertion times
You received this bug notification because you are a member of Zeitgeist
Framework Team, which is subscribed to Zeitgeist Framework.

Status in Zeitgeist Framework: Triaged

Bug description:
We insert pretty slowly with an average of 0.15 seconds for one event on my 
core i5 2.5 GHz beast.

RainCT had some optimization possibilities:
1) PRAGMA synchronous=OFF
2) PRAGMA journal_mode=OFF

The Chat:
<kamstrup> I think we are - but I can't recall... in case of failed 
transactions - but I don't even know if we use transactions these days...
<seif> <RainCT> try synchronous=OFF
<seif> <RainCT> but it can corrupt your database if your phone dies while ZG is 
<seif> <RainCT> and journal_mode=MEMORY
<seif> <RainCT> or OFF since we don't use rollback anyway
<seif> so maybe journal_mode = OFF is a good start?
<kamstrup> okay, he's probably right...
<kamstrup> 'grep -Ri rollback _zeitgeist/' is your friend :-)
<kamstrup> apparently we are not using rollback...

More info can be found here: http://www.sqlite.org/pragma.html

In order to get a better picture of what's going on, can you please try to get 
some more information, like:
1) How many events are in your database?
2) What's the insertion time for one event into an empty db?
3) Out of this 0.15 secs, how many time is spend in our python code, and what's 
the time of the actual sql action?
4) How much faster is adding 10 events at once compared to adding them one at a 
5) You think 0.15 secs is slow for inserting one event, what time do you 
expect, and why?

Mailing list: https://launchpad.net/~zeitgeist
Post to     : zeitgeist@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zeitgeist
More help   : https://help.launchpad.net/ListHelp

Reply via email to