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

Cobweb gem causes Rails app to run 10x slower #44

Closed
SimonBirrell opened this issue Sep 7, 2015 · 9 comments
Closed

Cobweb gem causes Rails app to run 10x slower #44

SimonBirrell opened this issue Sep 7, 2015 · 9 comments

Comments

@SimonBirrell
Copy link

Hi,

I have a very bare-bones Rails App, and when I add

gem 'cobweb'

to the Gemfile, run 'bundle' and restart, then all web requests take around 15s to execute instead of 1s. The weird thing is that I haven't even started calling Cobweb code at all.

There are no errors and MiniProfiler tells me that no time is begin spent in SQL. It's just much slower.

Any idea on where to start looking? Is the Gem initialising somehow, even if I'm not explicitly calling it?

Using Webrick and PostGres. Ruby 2.2.3 and Rails 4.2.4.

Thanks!

Simon

@SimonBirrell
Copy link
Author

Whatever it was, I seem to have fixed it by deleting the Gem and reinstalling it. Deleted it using JosephL's advice here:

http://stackoverflow.com/questions/12188833/how-to-reinstall-a-gem-using-bundler

@SimonBirrell
Copy link
Author

I take it back. This is still an issue. When the gem is properly reinstalled the web server speed drops from 2s to 50s.

Same if you force Webrick. Same if you use heroku local. I don't know what the gem is doing on initialization - I can't figure out why this should happen.

But it does.

@SimonBirrell SimonBirrell reopened this Nov 3, 2015
@SimonBirrell
Copy link
Author

Another datapoint. If you add the gems that cobweb depends on to the main application Gemfile, there's no problem. It's only when cobweb itself is added.

@stewartmckee
Copy link
Owner

Thanks Simon,

Cant think off hand what it could be, i'll take a look later and see if i find anything, on a train just now.

Stewart.

@stewartmckee
Copy link
Owner

had a quick look on the phone, first a couple questions... is it always the same amount of time delay? there are a couple monkey patch bits of code that should be considered. Also do you have a gemfile you are using (and lock) that i can plug into a test rails app, oh and version of rails too. There is a require that loads all rb files that are in the same or sub folders from lib/cobweb.rb, if its missbehaving, could be related.
Nothing obvious though, if you can send the above i'll het a test app running to try to replicate. Also, what version of cobweb your on too.

thanks,
Stewart.

@stewartmckee
Copy link
Owner

Thanks, after a bit of wrestling with recent el capitan update, i've been able to get rails installed and can replicate this locally with the rubygems gem. I'm going to now try to replicate with local copy and see what its up to.

@stewartmckee
Copy link
Owner

Ok, think i've found it, try version 1.0.29.

@stewartmckee
Copy link
Owner

Evil, Evil, Evil monkey patching on the String class with method_missing....

Glad its working now.

thanks,
Stewart.

@SimonBirrell
Copy link
Author

Great gem, thanks a lot for the fix!

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

2 participants