-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Significant performance improvements and code cleanup #20
base: master
Are you sure you want to change the base?
Commits on Sep 24, 2017
-
Fix tests, which now pass under stack LTS-6.35
Drop "old-locale" dependency and tests of conversions from obsolete "old-time" types. Added stack.yaml, for 6.35. Newer LTS versions can't build the tests due to version caps on template-haskell in dependencies. Compilation without the tests dependencies now works through at least LTS-9.5 and even stackage-nightly-2017-09-20.
Configuration menu - View commit details
-
Copy full SHA for 0e78b38 - Browse repository at this point
Copy the full SHA 0e78b38View commit details -
Initialize ppst to NULL just in case
We try to finalize it after failed calls, and, though the SQLite3 documentation promises that it will be initialized to NULL on error, this is liable to elicit compiler warnings, and is not "obviously" correct.
Configuration menu - View commit details
-
Copy full SHA for 45a24ef - Browse repository at this point
Copy the full SHA 45a24efView commit details -
Configuration menu - View commit details
-
Copy full SHA for 58c0d2a - Browse repository at this point
Copy the full SHA 58c0d2aView commit details -
- Missing type signatures - Shadowed names - Unused names - Ignored results - Incomplete pattern matches - Missing modules in cabal file * Fixed all warnings reported by GHC 7 in code and tests * Fixed all warnings reported by GHC 8 in the code, tests don't yet build due to version conflicts in dependencies.
Configuration menu - View commit details
-
Copy full SHA for ee94b10 - Browse repository at this point
Copy the full SHA ee94b10View commit details -
New connectSqlite3Ext function
This allows prepared statements to stay open, so that one can avoid the penalty of recompiling them each time. Applications that disable auto finish MUST finish() *every* statement handle they prepare(). This also supports use of native octet encodings of non-UTF-8 filenames. The existing connect functions are re-implemented in terms of connectSqlite3Ext. When auto-finish is off, it makes no sense to track the open statement handles that only the user will close. Therefore, ChildList becomes a (Maybe ChildList) and is unused when auto-finish is disabled. Since we're not finishing queries when the last result row is read, we at least promptly "reset" the statement, freeing up some of the underlying resources. Finally, single-use statements that the library prepares for its own internal purposes are never auto-finished, and finished explicitly instead. Most of these will become cached statements in the next commit. The previous implementation of clone() was incorrect, it forgot the filename encoding, this is now preserved along with the auto-finish flag.
Configuration menu - View commit details
-
Copy full SHA for dbf4d78 - Browse repository at this point
Copy the full SHA dbf4d78View commit details
Commits on Sep 25, 2017
-
Bypass preparing BEGIN, COMMIT and ROLLBACK
We don't need a statement handle for these, just call sqlite3_exec() via fexecuteRaw(). Also avoid creating a persistent statement handle for the gettables query and the one-shot queries processed by run and runRaw.
Configuration menu - View commit details
-
Copy full SHA for 9d30abc - Browse repository at this point
Copy the full SHA 9d30abcView commit details -
Save column names on prepare rather than on execute.
We'll use the "live" values with requests for an already prepared statement, and only fall-back to the saved values when finished after a previous prepare in auto-finish mode.
Configuration menu - View commit details
-
Copy full SHA for dbb60cd - Browse repository at this point
Copy the full SHA dbb60cdView commit details -
Added tests for auto-finish off mode.
With implicit auto-finish of course the finish happens at the right time automatically, but with auto-finish off, a bit more care is required to not reset the query before all the desired rows are examined. The explicit "finish" for the statements used to fetch all rows when using the lazy fetchAllRows needs to be delayed until the rows have been fully processed (by comparing with the expected values). This is not needed in the non-lazy fetchAllRows' case. Replaced quickQuery with safeQuickQuery' when not explicitly testing quickQuery. The latter is not safe when auto-finish is off. Applications that disable auto-finish must avoid functions like quickQuery and quickQuery' internally leak prepared statements. NB: quickQuery' could be changed to explicitly finish its statement handle.
Configuration menu - View commit details
-
Copy full SHA for 55e9f99 - Browse repository at this point
Copy the full SHA 55e9f99View commit details