Skip to content
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

Is it really async? #19

Open
msukhotin opened this issue Aug 7, 2015 · 1 comment
Open

Is it really async? #19

msukhotin opened this issue Aug 7, 2015 · 1 comment

Comments

@msukhotin
Copy link

Hi

I'm trying the following code:

var log = require('debug')('app:maxmind'),
    mmdbreader = require('maxmind-db-reader');

log('preparing');
var cities = mmdbreader.openSync('./data/GeoIP2-City.mmdb');
log('ready');
for (i=1; i<250; i++) {
    cities.getGeoData('5.'+i+'.143.20', function(err,geodata){
        if (!err && geodata && geodata.city)
            log(geodata.city.geoname_id);
    });
}
  app:maxmind preparing +0ms
  app:maxmind ready +81ms
  app:maxmind 677697 +181ms
  app:maxmind 680963 +1ms
  app:maxmind 287286 +1ms
  app:maxmind 745044 +0ms
  app:maxmind 745044 +0ms
  app:maxmind 295548 +0ms
  app:maxmind 294071 +0ms
  app:maxmind 292223 +0ms
  app:maxmind 287286 +1ms
  app:maxmind 3186886 +0ms
etc...

How could I explain why it took 181 ms to find first ip? Also results order is always the same.

@knoxcard
Copy link

knoxcard commented Dec 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants