Skip to content
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

Release 2.6 #101

Merged
merged 5 commits into from
May 25, 2015
Merged

Release 2.6 #101

merged 5 commits into from
May 25, 2015

Commits on May 25, 2015

  1. Use text-based columnar storage

    This changes the default data for mime-types from a JSON file to a set of text
    files, with one line per mime type, and one file per mime type attribute. This
    only loads the content_type and extensions for mime-types by default, reducing
    default memory usage of mime-types from over 22MB to just over 2MB.
    Additionally, it speeds up requiring from 0.38 seconds to about 0.10 seconds.
    
    Even when loading all of the attributes for the mime types, the memory usage of
    mime-types stays under 11MB, though load time increases to 0.52 seconds. I
    think that is an acceptable trade off.
    
    If the txt files are shipped instead of the json file, there is also a disk
    space savings of 167KB (392KB instead of 560KB).
    
    rake convert:yaml:txt has been added for converting the yaml files to the
    necessary txt files. In order to get the conversion to work, I had to make
    convert.rb turn on lazy loading for mime types.
    
    This should be completely backwards compatible if a path is given containing
    the types. The only current backwards compatibility difference is for the
    "text/directory - DEPRECATED by RFC6350" mime type, which looks to me like an
    invalid mime type anyway, and probably should be removed.
    
    * Pool encoding strings. Use a single string for each encoding. This decreases
      the number of encoding strings stored by default from 1909 to 4, saving about
      700KB of memory by default on 64-bit MRI.
    
    * While here, reduce object allocations while loading data from the mime type
      txt files.
    
    * Clear cache file in lazy test. This was causing the test-order dependent bug
      on JRuby. The clear_cache_file code was taken from the cache test.
    jeremyevans authored and halostatue committed May 25, 2015
    Configuration menu
    Copy the full SHA
    8ce1add View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4dae397 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0afaf42 View commit details
    Browse the repository at this point in the history
  4. Make column format optional, JSON is default.

    - For mime-types 2.6, columnar support is opt-in and will not be changed to
      default until mime-types 3.0. Restore JSON by default with
      mime/types/columnar for enabling it.
    
    - Rename from .txt to .column; fix some of the type errors in conversion caused
      by previously undetected bad data.
    
    - Keep the PATH protocol even though none of the Linux distributions are using
      it now.
    
    - Fix up the conversion method and benchmarking.
    halostatue committed May 25, 2015
    Configuration menu
    Copy the full SHA
    31b1014 View commit details
    Browse the repository at this point in the history
  5. mime-types 2.6 release ready code.

    - Extend documentation.
    - Add a logger and logger configuration.
    - Add more tests to Travis.
    - Update MIME registry.
    halostatue committed May 25, 2015
    Configuration menu
    Copy the full SHA
    98a75c0 View commit details
    Browse the repository at this point in the history