Seeing as how the largest dotted-quad IP address fits inside rax:rdx on a modern CPU, and that two of them fit in a single cache line, I'm guessing x == y, while faster, is not "much" faster with strings than integers.
I wouldn't populate an address trie with strings, but I also wouldn't give a second thought to passing them around a random C program as charstars either.
Most string libs aren't that smart though - string comparisons are still byte by byte. You're now comparing something 15 times instead of 1. You can do an int32/int64 (depending on architecture) compare in a single op.
The point I guess is, you can keep 'em around as charstars, but eventually you'll have to do this cast to compare them...
All memcmp's are this smart. But that's kind of besides the point, right? 1 time, 14 times, if we're talking about L1 cache, we're really epsilon from pure reg/reg ALU operations, implementing effectively constant-time algorithms.
I agree, int32 is faster. Like I said, it's just not "much" faster.
I wouldn't populate an address trie with strings, but I also wouldn't give a second thought to passing them around a random C program as charstars either.