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

Improve performance #52

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Improve performance #52

wants to merge 16 commits into from

Conversation

Uzlopak
Copy link
Contributor

@Uzlopak Uzlopak commented Sep 10, 2023

Currently working on the performance of this package.

There are still some perf gains to get.

Checklist

@mcollina
Copy link
Member

Note that we are not using this module in Fastify right now, but we switched back to upstream.

I'm ok to switch again if this gives an improvement.

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Sep 11, 2023

The thing is that we have already improvements because our forwarded fork is significantly faster.
fastify/forwarded#41

So we should have switched long time ago. :D

I am currently working on improving the performance for checking if the ip is trustable.

@mcollina
Copy link
Member

Can you make the switch again?

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

addr[1] === ':'
) {
if (
addr[2] === 'f' &&
Copy link
Member

Choose a reason for hiding this comment

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

is symbol-by-symbol check faster than resolving slice and comparing it as a whole?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

from my experience: yes.

@Uzlopak Uzlopak marked this pull request as draft September 11, 2023 11:44
@Uzlopak
Copy link
Contributor Author

Uzlopak commented Sep 11, 2023

sry, I have to investigate something.

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.

3 participants