-
-
Notifications
You must be signed in to change notification settings - Fork 122
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
Make RUBY_MIME_TYPES_LAZY_LOAD the default #62
Comments
== 2.6.1 / 2015-05-25 * Bugs: * Make columnar store handle all supported extensions, not just the first. * Avoid circular require when using the columnar store. == 2.6 / 2015-05-25 * New Feature: * Columnar data storage for the MIME::Types registry, contributed by Jeremy Evans (@jeremyevans). Reduces default memory use substantially (the mail gem drops from 19 Mib to about 3 Mib). Resolves {#96}[mime-types/ruby-mime-types#96], {#94}[mime-types/ruby-mime-types#94], {#83}[mime-types/ruby-mime-types#83]. Partially addresses {#64}[mime-types/ruby-mime-types#64] and {#62}[mime-types/ruby-mime-types#62]. * Development: * Removed caching of deprecation messages in preparation for mime-types 3.0. Now, deprecated methods will always warn their deprecation instead of only warning once. * Added a logger for deprecation messages. * Renamed <tt>lib/mime.rb</tt> to <tt>lib/mime/deprecations.rb</tt> to not conflict with the {mime}[https://rubygems.org/gems/mime] gem on behalf of the maintainers of the {Praxis Framework}[http://praxis-framework.io/]. Provided by Josep M. Blanquer (@blanquer), {#100}[mime-types/ruby-mime-types#100]. * Added the columnar data conversion tool, also provided by Jeremy Evans. * Documentation: * Improved documentation and ensured that all deprecated methods are marked as such in the documentation. * Development: * Added more Ruby variants to Travis CI. * Silenced deprecation messages for internal tools. Noisy deprecations are noisy, but that's the point. == 2.5 / 2015-04-25 * Bugs: * David Genord (@albus522) fixed a bug in loading MIME::types cache where a container loaded from cache did not have the expected +default_proc+, {#86}[mime-types/ruby-mime-types#86]. * Richard Schneeman (@schneems) provided a patch that substantially reduces unnecessary allocations. * Documentation: * Tibor Szolár (@flexik) fixed a typo in the README, {#82}[mime-types/ruby-mime-types#82] * Fixed {#80}[mime-types/ruby-mime-types#80], clarifying the relationship of MIME::Type#content_type and MIME::Type#simplified, with Ken Ip (@kenips). * Development: * Juanito Fatas (@JuanitoFatas) enabled container mode on Travis CI, {#87}[mime-types/ruby-mime-types#87]. * Moved development to a mime-types organization under {mime-types/ruby-mime-types}[https://github.com/mime-types/ruby-mime-types].
This would be fairly useful, but there is not much of a definable benefit to this as a default. I will do further investigation on this, but I think that I am more likely to look at removing the lazy load functionality entirely for mime-types 4.x because of the columnar capabilities added in 2.6 and improved in 3.0. |
came here because I noticed 0.3s of my boot time going into mime-types :( used this flag and ran 1 test each ... only showing 0.1s gain, but that might be because the files are hot/cached at this point, so not sure about the real gain but it is a step in the right direction ..
|
You should also look at using |
that would be awesome :) On Thu, May 12, 2016 at 10:19 PM, Austin Ziegler [email protected]
|
As previously discussed: this is being deprecated. Some testing suggests that it has no effective impact compared to the columnar loading that is the default version in v3. |
That feature has been deprecated by the upstream, cf. mime-types/ruby-mime-types#62 Setting it causes an ugly warning message to show up.
Although loading the MIME type registry is fairly fast, do not force people to pay that cost up front. Implement
ENV['RUBY_MIME_TYPES_LAZY_LOAD']
as the default behaviour and provide a new variable (ENV['RUBY_MIME_TYPES_IMMEDIATE_LOAD']
) to fall back to the old behaviour.The text was updated successfully, but these errors were encountered: