16 Jan 2010 robocoder   » (Journeyer)

Re-inventing the wheel. Sure, I could have used the ip2c library from FireStats, or the geoip code from MaxMind, but the former doesn't support shared memory and the latter is just fugly looking code.

So, I just coded/tested/benchmarked a new IP-to-country plugin for Active Analytics -- it'll be an optional, third-party plugin for Piwik. It can search the database in either a flat file or shared memory. (The difference is in the 10ths of a millisecond per query on my antiquated test box.)

In hindsight, I wasted a lot of time over-3ngin33ring the solution. I thought it would be safer to sign and check the integrity of the shared memory segment for users in a shared web hosting environment. I later realized this was a non-problem because shared web hosting doesn't offer access to shared memory (due to security and resource concerns). This came as a relief because signing and verifying killed the performance benefit of using shared memory.

[ed. "engineer" is a protected title here in Ontario.]

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!