RE: ip-to-country - summary
| From: | Divyank Turakhia | Date: | Wed, 30 Apr 2003 17:45:40 +0000 |
| Subject: | RE: ip-to-country - summary | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-17166@lists.php.net to get a copy of this message | ||
0.03 seconds sounds quite decent. Could you send me the script that you
have written for this, so that I can run a few tests and try tweaking
it.
- Divyank
>
> Well, I have created some code to index this db,
> and search in it. My tests with the search without
> index resulted in the 0.1-0.7 seconds time range. The
> last Japan entry was found in approx 0.7 seconds.
>
> Unhappy with the results, I have created a simple indexer
> (the one I have explained you before), indexing the ip
> numbers with 10^6 granularity. It resulted in much better
> speeds to search in the index first and then in the db. Then
> I found out, that having the index 10^7 granularity produces
> a very small index (one kilobyte!), and even better speed
> results. I have used simple linear search in both the index
> and the db, so this is why a smaller index also means better
> results, given that the IP ranges are quite wide.
>
> Now there are 0.03-0.05 seconds needed to find out a
> country if an IP address is given. Speed measures were
> taken on a windows machine, I'll do the same measures on
> Linux when I get home.
>
> Is this speed ok for phpweb?
>
> Goba
>
>