-
Notifications
You must be signed in to change notification settings - Fork 71
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
Parsing performance #9
Comments
I feel it is good idea about improvement to more faster parsing IP range text, I agree. But I don't have enough my resouce (my private time), and more important point, I have no skill to how to coding more faster parsing 😭 Could you improve this issue and send me pull request? P.S. |
Regex is very fast, and the use of regex here I'd say is appropriate. It could be made slightly faster, in some cases, by declaring static regex properties rather than in-line parameters, but even as-is, the compiled regular expressions are cached. Good reference about this: [https://msdn.microsoft.com/en-us/library/gg578045%28v=vs.110%29.aspx](Best Practices for Regular Expressions in the .NET Framework). Now, if you're suggesting something other than regex, my gut reaction is that it's the wrong way to go. There are a wide range of inputs, so anything that can handle all of them is going to be complex, and complex flow is hard to make robust. That said, the way forward is to make a pull request and include some comparative benchmarks showing the improvement. :) |
for example, IPAddress class use native system calls for parsing IPs, but for quick googling dont tell me
|
Hi, thanks for the great lib, the ONLY for the ranges!!! Really really useful.
The IP ranges mught be used on some really hot paths in the app, so, did you ever consider replacing Regex.Match with something more robust & fast?
The text was updated successfully, but these errors were encountered: