Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Jan 22, 2023

And also pgpass-related regex use

Closes #4896

@roji roji requested a review from vonzshik as a code owner January 22, 2023 23:18
And also pgpass-related regex use

Closes npgsql#4896
goto Finish;
ch = value[pos];
if (ch == '*')
switch (ch)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this hot enough to

Suggested change
switch (ch)
switch (ch | 0x20)

so to have the cases only for lowercase chars, thus saving some branches and code-size?
See sharplab

Copy link
Member Author

Choose a reason for hiding this comment

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

I definitely don't think this code is hot enough for micro-optimization.. In fact, we should consider removing the parsing logic altogether, as this PR does for the geometry types.

@roji roji merged commit 7c40906 into npgsql:main Jan 23, 2023
@roji roji deleted the RegexAway branch January 23, 2023 21:12
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.

Remove geometry type regex parsing logic (removing regex dependency entirely)

3 participants