GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-44165: optimise sqlite3 statement preparation by passing string size by erlend-aasland · Pull Request #26206 · python/cpython

Conversation

@erlend-aasland

@erlend-aasland erlend-aasland commented May 18, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Erlend E. Aasland
bpo-44165: optimise sqlite3 statement preparation by passing string size
f901fd5
@erlend-aasland
erlend-aasland requested a review from berkerpeksag as a code owner May 18, 2021 07:26
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label May 18, 2021
@bedevere-bot bedevere-bot added the awaiting review label May 18, 2021
@erlend-aasland

erlend-aasland commented May 18, 2021

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland erlend-aasland added the skip news label May 18, 2021
pablogsal
pablogsal reviewed May 19, 2021
View reviewed changes
Comment thread Modules/_sqlite/statement.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed May 19, 2021
View reviewed changes
Comment thread Modules/_sqlite/cursor.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Erlend E. Aasland
Pass -1 if size >= INT_MAX
9febd15
@erlend-aasland
erlend-aasland force-pushed the sqlite-prepare branch from f3657ac to 9febd15 Compare May 19, 2021 20:28
Erlend E. Aasland added 3 commits May 20, 2021 00:02
Erlend E. Aasland
Raise OverflowError if SQL string is too long
081de33
Erlend E. Aasland
Raise DataError iso. OverflowError to keep current behaviour
d981be6
Erlend E. Aasland
sqlite3_limit is cheap; use it directly iso. caching it in the connec…
d0d0618
…tion object
@erlend-aasland erlend-aasland closed this May 19, 2021
@erlend-aasland erlend-aasland reopened this May 19, 2021
pablogsal
pablogsal approved these changes Jun 2, 2021
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Jun 2, 2021
@pablogsal
pablogsal merged commit a384b6c into python:main Jun 2, 2021
@bedevere-bot bedevere-bot removed the awaiting merge label Jun 2, 2021
pablogsal
pablogsal reviewed Jun 2, 2021
View reviewed changes
Comment thread Modules/_sqlite/cursor.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

pablogsal
pablogsal reviewed Jun 2, 2021
View reviewed changes
Comment thread Modules/_sqlite/statement.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@erlend-aasland
erlend-aasland deleted the sqlite-prepare branch June 2, 2021 12:30
@python python deleted a comment from bedevere-bot Jun 2, 2021
@python python deleted a comment from bedevere-bot Jun 2, 2021
@erlend-aasland

erlend-aasland commented Jun 2, 2021

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull request Jun 2, 2021
Erlend E. Aasland
pysqlite_statement_create now returns a Py object, not an int
448ad9d
pythonGH-26206 was broken by pythonGH-26475.
@erlend-aasland erlend-aasland mentioned this pull request Jun 2, 2021
bpo-44165: pysqlite_statement_create() returns a PyObject *, not an int #26484
Merged
pablogsal pushed a commit that referenced this pull request Jun 2, 2021
Erlend Egeberg Aasland
bpo-44165: pysqlite_statement_create now returns a Py object, not an …
fbf25b8
…int (GH-26484)

GH-26206 was broken by GH-26475.
@erlend-aasland erlend-aasland mentioned this pull request May 16, 2022
[sqlite3] sqlite3_prepare_v2 micro optimisation: pass string size #88331
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pablogsal pablogsal pablogsal approved these changes
@berkerpeksag berkerpeksag Awaiting requested review from berkerpeksag

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@erlend-aasland @pablogsal @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.