Adam Shelly wrote: >> I would have bet Simon's would be faster. Strange! > > I thought block file reads would be faster too, that was the next > thing I was planning to try. Maybe it's the regexp that slowed it > down. Without looking at the other solutions in detail i think one of the problems may be that my solution opens the file for each lookup - thats of course easy to fix. I don't know if thats the problem or the overhead of creating ten thousand IPAddr objects - i refuse to analyse this in depth because i don't have a usecase for looking up that many locations in a single run. (on the other hand i do understand how much fun it can be to optimize such a problem to death - so go on if you like, i don't have the motivation - this time :) cheers Simon