-
Couldn't load subscription status.
- Fork 8k
Minor improvements in sqlite3 extension #17751
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
Conversation
This simplifies the code and reduces memory usage.
These checks are always false because we're receiving a valid zend_object.
d94bd2e to
5f1aa3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSTM Another packing suggestion
| bool initialised; | ||
| sqlite3 *db; | ||
| php_sqlite3_func *funcs; | ||
| php_sqlite3_collation *collations; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you move this next to the exception field to back it? As there are going to be 7 bytes of padding, and then again a bunch of padding after the exception field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't do it originally because it seemed better to keep db and initialised in the same cacheline, but I see now that I can just move exception up and it will result in the same struct size while keeping db and initialised together.
Review commits one by one. This reduces memory usage, uses cheaper string functions, and cleans up the code a bit.