This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erlendaasland
Recipients berker.peksag, erlendaasland, serhiy.storchaka
Date 2021-05-04.23:41:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org>
In-reply-to
Content
The following optimisations can be applied to _pysqlite_connection_begin():

1. Return an int instead of a PyObject pointer

   Per now, we do Py_RETURN_NONE and Py_DECREF(result) if _pysqlite_connection_begin() was successful (normally the case). There's no reason to do this. Let's just it the C way: return -1 on error and 0 if things are ok.


2. Defer error checking till post sqlite3_finalize()

   Any error code returned by sqlite3_step() will also be returned by sqlite3_finalize() for the same statement. From the SQLite docs:
   "If the most recent evaluation of statement S failed, then sqlite3_finalize(S) returns the appropriate error code or extended error code."


3. Move _pysqlite_connection_begin() to Modules/_sqlite/cursor.c

   The single use is in _pysqlite_query_execute() in cursor.c. Moving it makes it possible for the compiler to apply more optimisations. At least so I've heard :)
   (As a side effect, the namespace will be cleaner.)
History
Date User Action Args
2021-05-04 23:41:24erlendaaslandsetrecipients: + erlendaasland, berker.peksag, serhiy.storchaka
2021-05-04 23:41:24erlendaaslandsetmessageid: <1620171684.78.0.466363049979.issue44042@roundup.psfhosted.org>
2021-05-04 23:41:24erlendaaslandlinkissue44042 messages
2021-05-04 23:41:24erlendaaslandcreate