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

Faster startup and mass lookups, returns real booleans #16

wants to merge 6 commits into
base: master


None yet
2 participants

kwebble commented Sep 13, 2014

Hi there. I wanted to use the browscap data in a program that processes a HTTP log, so to parse lots of strings, but the original version took too much time. Fortunately I could speed things up.

This version is major rewrite, giving 2 speed improvements:

  1. Not all properties from parents are copied to every browser configuration, but the parent-child relationship is used. This reduces the time to parse the .ini file. In getBrowser, properties are retrieved from the matching browser, then going up the parent tree more generic properties are filled.
  2. Results of getBrowser calls are stored. Subsequent calls for the same string are retrieved from this cache, giving a faster response.

One feature change, properties with string values 'true' and 'false' are converted to boolean values.

I also changed the code formatting to my preferences, hope you don't mind too much.

kind regards,
rob schlüter

@dangrossman dangrossman closed this Feb 4, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment