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

Investigate the use of a value pool to reduce object creation #64

Open
halostatue opened this issue May 23, 2014 · 1 comment
Open

Investigate the use of a value pool to reduce object creation #64

halostatue opened this issue May 23, 2014 · 1 comment
Assignees
Labels
Milestone

Comments

@halostatue
Copy link
Member

Based on work by Charlie Somerville (@charliesome); found at SamSaffron@ca0bce0 and SamSaffron@6b34ec6.

@halostatue halostatue added this to the 2.4 milestone May 23, 2014
@halostatue halostatue self-assigned this May 23, 2014
@halostatue halostatue modified the milestones: 2.5, 2.4 Oct 7, 2014
@halostatue halostatue modified the milestones: 2.5, 3.0 Apr 26, 2015
jsonn pushed a commit to jsonn/pkgsrc that referenced this issue Jun 8, 2015
== 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].
@halostatue halostatue modified the milestones: Future, 3.0 Nov 21, 2015
@halostatue
Copy link
Member Author

I’ve brought the changes in on a branch that will be pushed after 3.0 is released—initial benchmarking looks reasonable, but there’s a lot more allocations in exchange for a lot fewer objects (about 8k fewer objects in both full and columnar cases, which is fairly significant).

    Before
              Full      Columnar    Columnar Full
Allocations   212,916   124,021     178,153
Objects       54,792     30,307      30,307

    After
              Full      Columnar    Columnar Full
Allocations   234,602   142,975     197,113
Objects       46,277     21,880      21,880

                                     user     system      total        real
Normal                           6.770000   0.150000   6.920000 (  6.967850)
Columnar                        10.190000   0.090000  10.280000 ( 10.347297)
Columnar Full                   11.430000   0.120000  11.550000 ( 11.589130)
Cache Initialize                 0.220000   0.000000   0.220000 (  0.239905)
Cached                           4.320000   0.070000   4.390000 (  4.646856)
Columnar Cache Initialize        0.260000   0.000000   0.260000 (  0.265293)
Columnar Cached                  2.270000   0.040000   2.310000 (  2.594322)

In the full (json) case, the performance over 50 loads (rake benchmark:load) is about a full second slower (~20ms for a single load), but it has no apparent impact in the columnar cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant