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

Memory bloat in method_missing #28

Open
Epigene opened this issue Feb 13, 2020 · 0 comments
Open

Memory bloat in method_missing #28

Epigene opened this issue Feb 13, 2020 · 0 comments

Comments

@Epigene
Copy link

Epigene commented Feb 13, 2020

Hi, we're using v1.0.0 (via Virtus v1.0.5), and running memory_profiler gem's report on a loop-intensive part of our code reports that coercible is allocating 90% of strings:

Allocated String Report
-----------------------------------
   2134952  "to_object"
   2134952  /bundle/ruby/2.5.0/gems/coercible-1.0.0/lib/coercible/coercer/object.rb:164

    100361  "amd"
    100361  /bundle/ruby/2.5.0/gems/money-6.11.3/lib/money/currency.rb:39

     83296  ""
     38591  /bundle/ruby/2.5.0/gems/activerecord-5.0.7.2/lib/active_record/connection_adapters/mysql/database_statements.rb:37

Could freezing strings avoid this?

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

No branches or pull requests

1 participant