Comments (5)
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.
from ruby-mime-types.
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 ..
RUBY_MIME_TYPES_LAZY_LOAD=true
runs: 10
total: 53.86
average: 5.39
range: 5.27..5.82
without:
runs: 10
total: 54.48
average: 5.45
range: 5.35..5.54
from ruby-mime-types.
You should also look at using require: 'mime/types/columnar'
in your Gemfile since you appear to be stuck on 2.99.x, which will do a different form of lazy loading (columnar, so you get fast lookups for minimal data). The other advantage on this is that it will drop the memory of use MIME::Types by about 1/3. I am trying to get rest-client to loosen the MIME::Types version they require so that MIME::Types 3 can be used (it allows for independent updating of the data file), and the zendesk_api should probably do the same.
from ruby-mime-types.
that would be awesome :)
On Thu, May 12, 2016 at 10:19 PM, Austin Ziegler [email protected]
wrote:
You should also look at using require: 'mime/types/columnar' in your
Gemfile since you appear to be stuck on 2.99.x, which will do a
different form of lazy loading (columnar, so you get fast lookups for
minimal data). The other advantage on this is that it will drop the memory
of use MIME::Types by about 1/3. I am trying to get rest-client to loosen
the MIME::Types version they require so that MIME::Types 3 can be used (it
allows for independent updating of the data file), and the zendesk_api
should probably do the same.—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#62 (comment)
from ruby-mime-types.
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.
from ruby-mime-types.
Related Issues (20)
- Memory usage/overhead? HOT 56
- Where is audio/mp3?? HOT 1
- Strange issue with 3.1, background jobs, Heroku and HTML email attachments (#117) HOT 6
- perhaps remove link to rubyforge HOT 3
- "text/comma-separated-values" has higher priority than "text/csv"
- Markdown returns wrong content-type. HOT 1
- MIME::Types[/regex/]: Exception thrown for unmatched regex HOT 2
- Uncontrolled growth of the type variants or extension index lists
- Wrong preferred_extension for application/pdf HOT 1
- Splitted 7z file -> mime type "" HOT 1
- Ruby 2.7.0 uses "_1", "_2", "_3" as "numbered parameters" HOT 2
- Nondeterministic order of MIME::Types.type_for HOT 9
- rdoc out of date HOT 1
- Compatibility with file(1)? HOT 1
- syntax error after update version 3.4.0 HOT 3
- How to use MIME::Types.type_for to accurately find the right mime type of file HOT 1
- Random warnings for "Type application/netcdf is already registered as a variant of application/netcdf." HOT 2
- MIME::Type defines #eql? but not #hash HOT 1
- Error in MIME::Types::WarnLogger HOT 3
- Handling of `\n` character in MIME::Types.type_for HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-mime-types.