Reduce number of sqlite transactions#41
Open
mattboehm wants to merge 3 commits into
Open
Conversation
* calling `time run_test.sh -m` can be used to measure performance
Creating a new transaction for every sql operation causes performance issues. Instead, wait until multiple changes have been made before committing. Doing so speeds up the tracing of a sample program by a factor of 3-4. Still need to look into adding tests/docs, but want to get this commit out there first so that the general strategy being used here can be reviewed.
Contributor
Author
|
Time to run Running with a buffer size of 50 wasn't appreciably different from 20. |
Contributor
Author
|
It's much easier to view the diff by ignoring whitespace changes (adding Feel free to recommend style changes, no matter how minute. Some of the variable/function names could probably use improvement. |
| self.conn = self._open_db(name) | ||
| # Cursor used by _insert for all insert/update/delete segments. | ||
| self._cursor = self.conn.cursor() | ||
| # TODO force a flush on sys.atexit()? Is that too dirty? |
Contributor
Author
There was a problem hiding this comment.
Thoughts on this?
Contributor
Author
|
fixes #34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I still need to work on docs/tests, but wanted to get some initial feedback first.
All unit tests passed without any modification. Additionally, recording runs before/after the changes produced identical replays.