Skip to content

bpo-44165: optimise sqlite3 statement preparation by passing string size - #26206

Merged
pablogsal merged 5 commits into
python:mainfrom
erlend-aasland:sqlite-prepare
Jun 2, 2021
Merged

bpo-44165: optimise sqlite3 statement preparation by passing string size#26206
pablogsal merged 5 commits into
python:mainfrom
erlend-aasland:sqlite-prepare

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented May 18, 2021

Copy link
Copy Markdown
Contributor

Quoting the SQLite docs, https://sqlite.org/c3ref/prepare.html:
"If the caller knows that the supplied string is nul-terminated, then
there is a small performance advantage to passing an nByte parameter
that is the number of bytes in the input string including the
nul-terminator."

https://bugs.python.org/issue44165

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

@pablogsal I recon this can pass as skip news. This is an internal micro-optimisation only. No user visible change.

Comment threadModules/_sqlite/statement.c Outdated
Comment threadModules/_sqlite/cursor.c Outdated
Comment threadModules/_sqlite/cursor.c
Comment threadModules/_sqlite/statement.c
@erlend-aasland
erlend-aasland deleted the sqlite-prepare branch June 2, 2021 12:30
@pythonpython deleted a comment from bedevere-botJun 2, 2021
@pythonpython deleted a comment from bedevere-botJun 2, 2021
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

This PR was broken by fffa0f9. I'll resolve the issues in a new PR.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@pablogsal@the-knights-who-say-ni@bedevere-bot