benlowry/node-geoip-native — pull request #2 by nitram509 (2012-11-04 23:57:41+00:00)
Title: More speed and less memory usage via code generation

Hi,

I've made some more progressive enhancements within my fork of 'node-geoip-native'.
The basic ideas:
* generating JS code from CSV file in 'build phase' or manual
* generated sources can be used via normal require statement
* thus theres no warmup needed anymore
* thus the memory usage drops heavily
* split the IPs and Countries in two separate arrays,
* thus the memory usage drops heavily
* using more compact version of binary search
* fixed all tests with lookup errors (see unit tests)

In general, I've measured ca. 10% performance increase during lookup
and a drop from ca. 50MB to ca. 30MB heap usage.

Please, check out this branch 'code_generation' and tell me what you think.

Tanks in advance
Martin