Skip to content

Conversation

@mattboehm
Copy link
Contributor

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.

* 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.
@mattboehm
Copy link
Contributor Author

Time to run test_app/run_test.sh -m (early 2014 macbook air; 1.4ghz i5 on battery power):

Before adding buffer logic:
real    0m8.241s
user    0m2.730s
sys 0m2.924s

SQL_STATEMENT_BUFFER_SIZE = 1:
real    0m7.563s
user    0m2.229s
sys 0m2.655s

SQL_STATEMENT_BUFFER_SIZE = 5:
real    0m2.628s
user    0m1.590s
sys 0m0.877s

SQL_STATEMENT_BUFFER_SIZE = 10:
real    0m2.119s
user    0m1.500s
sys 0m0.668s

SQL_STATEMENT_BUFFER_SIZE = 20:
real    0m1.907s
user    0m1.505s
sys 0m0.722s

Running with a buffer size of 50 wasn't appreciably different from 20.

@mattboehm
Copy link
Contributor Author

It's much easier to view the diff by ignoring whitespace changes (adding ?w=2 to the end of the url).

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?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on this?

@mattboehm
Copy link
Contributor Author

fixes #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant