private-ip icon indicating copy to clipboard operation
private-ip copied to clipboard

Performance issues

Open titanism opened this issue 1 year ago • 0 comments

The usage of ip_regex.v6().test(ip) on every invocation as well as this massive conditional (with the same regex re-used over and over, as opposed to defining as constants in-memory at top root level of file, cause major performance issues.

https://github.com/frenchbread/private-ip/blob/9d984ed3cd6d17d1d5a0f0d358c13c4c7a8996dd/src/index.ts#L45-L57

Also see the PR we made at https://github.com/frenchbread/private-ip/pull/27

In the interim, we've dropped private-ip usage completely because of this and instead we use localhost-url-regex

titanism avatar Nov 26 '24 08:11 titanism