-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Nested fields rendering is very slow in Rails 4.2.1 #1237
Comments
Interesting, did anything else change besides the Rails version? For example, I18n, or any other gem. Also, which Ruby version are you using? We may need to try to isolate that into a new app somehow to figure out what could be causing this. Thanks for your report. |
I will create isolated rails app today and try to find an issue. |
Hmm. It seems it is an issue with one of gems in the app. I'll continue researching, then put results here. |
Whew. I found the reason. It was This happens in Beware of using it until its developers didn't fix this bug. |
Awesome, thanks for reporting back ❤️, glad it's not a Simple Form issue :). |
Had the same problem. Rails 4.2.1, Ruby 2.16 and Ruby 2.2.2 disabling binding_of_caller didn't solved for me, disabling webconsole did. |
|
After more tests: On Ruby 2.2.2, disabling web-console, but maintaining better_errors and binding_of_caller solves the problem. On Ruby 2.1.6 only by diabling them all solves it. @carlosantoniodasilva, any tips on how can I investigate it further? |
Interesting.. but this happens on development, or production? (and if it is production, why having those gems in there?) I don't have any idea really, but maybe you could start by creating a sample app that shows and isolates the problem as much as possible, so that someone can try to help more easily. |
Develoment ( i have those gems enabled only on dev ). |
@tanraya how do you think, that was related to RubyVM::DebugInspector? |
Same here and I don't use any of this gems
@carlosantoniodasilva any idea? |
Maybe related with #1227? |
Using Ruby 2.2.2, I also had the issue and resolved by removing web-console from Gemfile. Rendering times went from 700-1800ms to 40-70 ms. Whew! I had found #1227 first and the suggestions there didn't help me. |
Seriously thank you for posting this. I was battling with a huge performance hit because of this bug. Removing better errors and binding of caller shaved a whole 3 seconds and got my page load down to 250ms. |
See #1227 (comment). I think the root cause is actually in simple_forms, not in binding_of_caller. |
Just switched to Rails 4.2.1 and found an performance issue with
simple_filelds_for
rendering.In Rails 4.1.6 it works fast enough:
Rendered shared/_phone_fields.html.erb (59.0ms)
However, in Rails 4.2.1 it works quite slowly:
Rendered shared/_phone_fields.html.erb (226.1ms)
In both rails versions the code is the same (simplified):
If I change the code to default rails form helpers, it works without performance drops.
Here's the ruby-prof stats for Rails 4.2.1 http://pastebin.com/NSXwCBEU and for 4.1.6 http://pastebin.com/4waUaveA
Any suggestions or ideas?
The text was updated successfully, but these errors were encountered: