Improve insertion times
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Zeitgeist Framework |
Fix Released
|
Wishlist
|
Seif Lotfy |
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 inserting
<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://
-------
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 time?
5) You think 0.15 secs is slow for inserting one event, what time do you expect, and why?
Related branches
- Siegfried Gevatter: Approve
-
Diff: 20 lines (+10/-0)1 file modified_zeitgeist/engine/sql.py (+10/-0)
summary: |
- Slow insertion times on maemo + Slow insertion times |
description: | updated |
summary: |
- Slow insertion times + Improve insertion times |
description: | updated |
Changed in zeitgeist: | |
assignee: | nobody → Seif Lotfy (seif) |
status: | New → Triaged |
importance: | Undecided → Wishlist |
description: | updated |
Changed in zeitgeist: | |
status: | Triaged → In Progress |
Changed in zeitgeist: | |
milestone: | none → 0.6 |
Changed in zeitgeist: | |
milestone: | 0.6 → 0.7 |
Changed in zeitgeist: | |
milestone: | 0.7.0 → none |
Changed in zeitgeist: | |
milestone: | none → 0.8.0 |
Changed in zeitgeist: | |
status: | In Progress → Fix Committed |
status: | Fix Committed → Fix Released |
Here is a diff... https:/ /code.edge. launchpad. net/~zeitgeist/ zeitgeist/ sqlite- insert- improvements/ +merge/ 35701
Here I only set the journal_mode to off since we dont use rollback thus we can not be harmed AFAIK. It improved my average speed to 0.075 seconds which is better.
I also benchmarked the synchronous = OFF for get 0.001 average but a lot of risks come with it. So I did not commit this change.