class Leonardo  
  require 'benchmark' 

  def self.test 
    n = 50000 

    Benchmark.bm do |x| 
      x.report { n.times do ; Leonardo.hive_geoip2; end } 
      x.report { 1.upto(n) do ; Leonardo.maxminddb; end } 
    end 
  end 

  def self.hive_geoip2 
    Hive::GeoIP2.lookup('88.174.0.1', 'db/GeoLite2-Country.mmdb') 
  end 

  def self.maxminddb 
    db = MaxMindDB.new('db/GeoLite2-Country.mmdb') 
    db.lookup('74.125.225.224') 
  end 
end  

Result:

     user    system     total        real 
 7.850000  1.260000  9.110000 (  9.125909) 
37.210000 35.370000 72.580000 ( 72.703302)  

hive_geoip2 which use libmaxminddb C lib is a lot faster.

https://github.com/desuwa/hive_geoip2
https://github.com/yhirose/maxminddb