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

proxy: lazily parse startup pg params #7905

Merged
merged 1 commit into from
May 30, 2024
Merged

Conversation

conradludgate
Copy link
Contributor

@conradludgate conradludgate commented May 29, 2024

Problem

proxy params being a HashMap<String,String> when it contains just

application_name: psql
database: neondb
user: neondb_owner

is quite wasteful allocation wise.

Summary of changes

Keep the params in the wire protocol form, eg:

application_name\0psql\0database\0neondb\0user\0neondb_owner\0

Using a linear search for the map is fast enough at small sizes, which is the normal case.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

Copy link

github-actions bot commented May 29, 2024

3150 tests run: 3017 passed, 0 failed, 133 skipped (full report)


Flaky tests (1)

Postgres 15

  • test_statvfs_pressure_usage: debug

Code coverage* (full report)

  • functions: 31.4% (6485 of 20666 functions)
  • lines: 48.4% (50207 of 103758 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
9490d93 at 2024-05-30T11:10:52.147Z :recycle:

@conradludgate conradludgate marked this pull request as ready for review May 29, 2024 18:09
@conradludgate conradludgate requested a review from a team as a code owner May 30, 2024 10:24
@conradludgate conradludgate enabled auto-merge (squash) May 30, 2024 10:24
@conradludgate conradludgate merged commit 9a081c2 into main May 30, 2024
58 of 59 checks passed
@conradludgate conradludgate deleted the compress-pq-params branch May 30, 2024 11:02
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 this pull request may close these issues.

2 participants