Skip to content

ext/pgsql: globals data struct rework/size reduction #18503

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

Merged
merged 2 commits into from
May 5, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/pgsql/php_pgsql.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,12 @@ static const php_stream_ops php_stream_pgsql_fd_ops = {
ZEND_BEGIN_MODULE_GLOBALS(pgsql)
zend_long num_links,num_persistent;
zend_long max_links,max_persistent;
Comment on lines 181 to 182
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I compute this correctly, you are splitting the max_links and max_persistent fields on different cache lines. This might be worse than having a tiny bit of padding between the bools and the 3 HTs at the end.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that s true ... let me see.

bool allow_persistent;
int ignore_notices;
zend_long auto_reset_persistent;
int log_notices;
zend_object *default_link; /* default link when connection is omitted */
zend_string *regexes[PGSQL_MAX_REGEXES];
bool allow_persistent;
bool ignore_notices;
bool log_notices;
HashTable field_oids;
HashTable table_oids;
HashTable connections;
Expand Down