[New-bugs-announce] [issue44822] [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()

Erlend E. Aasland report at bugs.python.org
Wed Aug 4 04:29:38 EDT 2021


New submission from Erlend E. Aasland <erlend.aasland at innova.no>:

The third argument to sqlite3_result_text() is the length of the string passed as the second argument. Currently, we pass -1, so SQLite has to invoke strlen() to compute the length of the passed string. Suggesting to use PyUnicode_AsUTF8AndSize() iso. PyUnicode_AsUTF8() and pass the string size to avoid the superfluous strlen().

See also:
- https://sqlite.org/c3ref/result_blob.html

----------
assignee: erlendaasland
components: Extension Modules
messages: 398865
nosy: erlendaasland
priority: normal
severity: normal
status: open
title: [sqlite3] Micro-optimisation: pass string size to sqlite3_result_text()
type: enhancement
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44822>
_______________________________________


More information about the New-bugs-announce mailing list