Get the latest tech news
Fastest way to get IPv4 address from string
I have the following code which is about 7 times faster than inet_addr . I was wondering if there is a way to improve this to make it even faster or if a faster alternative exists. This code requi...
Since we are speaking about maximizing throughput of IP address parsing, I suggest using a vectorized solution. Note that random trashy bytes after the end of the string may in principle cause increased memory footprint in the lookup table. EDIT: you can find a version modified by @IwillnotexistIdonotexist in comments, which uses lookup table of only 4Kb size (it is a bit slower, though).
Or read this on Hacker News