[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-06-03 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset 3446516ffa92c98519146253153484291947b273 by Erlend Egeberg 
Aasland in branch 'main':
bpo-44042: Optimize sqlite3 begin transaction (GH-25908)
https://github.com/python/cpython/commit/3446516ffa92c98519146253153484291947b273


--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-06-03 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy:  -pablogsal
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-05-04 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
keywords: +patch
pull_requests: +24576
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/25908

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44042] [sqlite3] _pysqlite_connection_begin() optimisations

2021-05-04 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

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.)

--
messages: 392967
nosy: berker.peksag, erlendaasland, serhiy.storchaka
priority: normal
severity: normal
status: open
title: [sqlite3]  _pysqlite_connection_begin() optimisations
type: performance
versions: Python 3.11

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com