-
Notifications
You must be signed in to change notification settings - Fork 128
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
Inclusion of 'treat' gem causes rails app to be very slow #84
Comments
Can you provide more detail? How are you including Treat? What is your Rails setup? |
I.e. what version of Ruby, what version of Rails, what other gems are included (would be helpful if you could provide a .gemfile), whether you are including the Treat DSL in addition to the gem, whether the problem occurs only in development or in production mode as well. You could also use |
Will get more details with ruby-prof today. There is no method being invoked from treat just putting the treat gem into the Gemfile slows it down Even rendering a page with no Db call Rails 4.1.4, ruby 2.1.2 More details coming Sent from my iPhone
|
|
There seems to be Treat method missing calls that is slowing alot of it down. |
|
The first one is with and the second one without Treat loaded? |
Also, did you do |
That's right the second one is without treat gem Yes I did do include Treat::Core::DSL in one of the classes Sent from my iPhone
|
The trace is a bit hard to interpret - I will look into it more next week when I have time. For now you can just drop the Treat::Core::DSL include and use the full class names instead, which should solve your problem. |
Having the same issue. Dropped the Treat::Core::DSL include and it still didn't speed up. Also had to include the zip-zip gem, as treat seems to want an old version of rubyzip and the rest of the app wants the later >1.0 version. Ruby 1.9.3, rails 3.2.19 |
Having same issue.
require 'treat'
module TextParser
module Treat
extend self
# commenting next line doesn't help. So problem is in requiring treat.
extend ::Treat::Core::DSL
end
end
end When I stop web server using CTRL-C
|
https://github.com/louismullie/treat/blob/master/lib/treat/proxies/string.rb |
Same problem here. Any thoughts on a different way to handle this? |
You're getting the error on MRI w/Puma? Can your app delegate this work to a worker queue / separate process as well as not requiring treat until needed? |
It's not really an error, just an extreme drop in performance. Yep, it's on MRI 2.2.2 and Puma. I'll try it in a worker, I'll have to see how it is currently being loaded. I'm not sure what the impact will be on the worker, I imagine it will experience the same drop in performance. |
Here's the issue demonstrated with benchmark-ips: irb 2.2.3 :002 > 2.2.3 :003 >
2.2.3 :004 > 2.2.3 :005 >
So - just including 'treat' gem has caused some rails basics to start performing at < 50%. |
WRT @Zhomart 's comment, wouldn't it make sense to change those methods from |
For some reason the rails app runs very slow when the treat gem is included in the rails app. basic views with nothing takes 1041ms to render,
remove treat gem and Voila everything goes back to normal.
The text was updated successfully, but these errors were encountered: