Proposal re arrange files for efficiency

James Titcumb edited this page Apr 30, 2014 · 4 revisions

To discuss this proposal, please see

At the moment there have been a few complaints (browscap/browscap/#197, browscap/browscap-php#20 and here), about memory usage parsing the files. At it's core, Browscap is probably mostly used for identifying browsers by way of UA sniffing. Therefore, the "lite" version should be suitable for most common browsers. "standard" version should include all UAs, and a little more info, but not be so large. "full" version should include everything and the kitchen sink, but I guess it would not be used so much.

This proposal should dramatically help reduce the file size, and thus memory usage parsing the files:

Lite versions

  • Only include UAs marked with lite: true
  • Review which UAs are marked with lite: true to ensure any old/less common browsers do not have that flag
  • Only include the following properties in the generation:
    • Parent
    • Comment
    • Browser
    • Platform
    • Version
    • isMobileDevice
    • isTablet
    • Device_Type

Standard versions

  • Include all UAs
  • Include all the properties in the Lite versions plus:
    • MajorVer
    • MinorVer
    • Win32
    • Win64
    • Browser_Maker
    • Device_Pointing_Method

Full versions

  • Include all UAs
  • Include all properties