Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sqlite3: Replace Py_BuildValue with faster APIs #93829

Closed
erlend-aasland opened this issue Jun 15, 2022 · 0 comments · Fixed by #93830
Closed

sqlite3: Replace Py_BuildValue with faster APIs #93829

erlend-aasland opened this issue Jun 15, 2022 · 0 comments · Fixed by #93830

Comments

@erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Jun 15, 2022

/* look for an adapter in the registry */
key = Py_BuildValue("(OO)", (PyObject*)Py_TYPE(obj), proto);
if (!key) {
return NULL;
}

Can use faster PyTuple_Pack.

key = Py_BuildValue("(OO)", (PyObject*)type, proto);
if (!key) {
return -1;
}

Can use faster PyTuple_Pack.

} else {
return Py_BuildValue("i", sqlite3_total_changes(self->db));
}

Can use PyLong_FromLong.

erlend-aasland added a commit to erlend-aasland/cpython that referenced this issue Jun 15, 2022
erlend-aasland added a commit that referenced this issue Jun 15, 2022
- In Modules/_sqlite/connection.c, use PyLong_FromLong
- In Modules/_sqlite/microprotocols.c, use PyTuple_Pack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant