Comments (20)
No, it is not a known problem. Could you please compare assets rendering w/o debugger?
Is there any difference? Also could you please use the same version of ruby-debug-ide for both cases.
from debase.
I am also having this issue. Massive slowdown when using debugger in ruby 2.1.3/2.1.4 It takes over 20 seconds just to start my test suite where as without debugger it takes less than 5. The code base for the test suite is very large with many rails plugins and mountable engines.
from debase.
+1 experience the slowdown with ruby 2.1.4
from debase.
It would be nice to have some project to reproduce the problem (my simple projects don't demonstrate it :(
I have identified one suspicious change in ruby code but I can not verify if this is the cause until I reproduce the problem.
from debase.
Unfortunately the project I work on is under close source. :( What change do you think may have caused the issue. If you point to the change in ruby I can investigate and see if anything obvious stands out that might relate specifically to our code base.
from debase.
Here are changes in vm_trace.c in ruby which look suspicious.
To verify that you need to remove these two lines, rebuild ruby from sources and try you project with patched version.
--- ./ruby-2.1.2/vm_trace.c 2013-12-17 11:19:25.000000000 +0400
+++ ./ruby-2.1.3/vm_trace.c 2014-07-30 19:52:15.000000000 +0400
@@ -335,6 +335,7 @@
trace_arg->self != rb_mRubyVMFrozenCore /* skip special methods. TODO: remove it. */) {
const VALUE errinfo = th->errinfo;
const int outer_state = th->state;
-
@@ -355,6 +356,7 @@
const VALUE old_recursive = rb_threadptr_reset_recursive_data(th); int state = 0; th->state = 0; th->errinfo = Qnil;
terminate:
th->trace_arg = 0;
th->vm->trace_running--; -
rb_threadptr_restore_recursive_data(th, old_recursive); if (state) { if (pop_p) {
from debase.
Humm. The formatting seems to have gone a bit wonky. I don't have time to try recompiling right now. Do you think this is something that debase can work around or will all future versions need to be recompiled without these recursive functions?
from debase.
I think if this is the problematic case we will need to discuss with ruby developers about possible ways to either improve ruby implementation or debase code
from debase.
I can confirm issue still exists with ruby 2.1.5. Also I tried using 2.1.2 and its still painfully slow. I'm now not convinced the issue is due to the ruby version.
from debase.
Need a test project to work with :(
from debase.
I've created a test app on github :
https://github.com/Olivier4murs/debase-slow-assets
- Ruby 2.1.2
Fast Debugger (ruby-debug-ide 0.4.23.beta11, debase 0.1.0) listens on 127.0.0.1:56270
Started GET "/" for 127.0.0.1 at 2014-11-14 13:01:33 +0100
Processing by PagesController#index as HTML
Page Load (0.3ms) SELECT "pages".* FROM "pages"
Rendered pages/index.html.erb within layouts/application (1.8ms)
Completed 200 OK in 560ms (Views: 557.5ms | ActiveRecord: 0.3ms) - Ruby 2.1.4
Fast Debugger (ruby-debug-ide 0.4.23.beta11, debase 0.1.0) listens on 127.0.0.1:56443
Started GET "/" for 127.0.0.1 at 2014-11-14 13:04:00 +0100
Processing by PagesController#index as HTML
Page Load (0.7ms) SELECT "pages".* FROM "pages"
Rendered pages/index.html.erb within layouts/application (4.8ms)
Completed 200 OK in 2082ms (Views: 2076.9ms | ActiveRecord: 0.7ms)
from debase.
I was able to reproduce the problem with https://github.com/railstutorial/sample_app_rails_4 and have confirmed my theory that this is a fix for ruby bug https://bugs.ruby-lang.org/issues/9940 who causes this performance regression. Will contact ruby developers to see what we can do here.
from debase.
I've created https://bugs.ruby-lang.org/issues/10511
from debase.
The problem has been fixed in 2.2.0-dev (see https://bugs.ruby-lang.org/issues/10511)
Unfortunately I'm unable to test it with sample_app_rails_4 because sqlite can not be built with it :( at least on my system)
Could you please try your tests with the version.
from debase.
It works better but still far slower than 2.1.2
On my test app :
ruby 2.0.0 : 350ms
ruby 2.1.2 : 540ms
ruby 2.1.4 : 2165ms
ruby 2.2-head : 1376ms
from debase.
I have tried https://github.com/Olivier4murs/debase-slow-assets and see similar results :(2.2-head is 1.5-2 times slower than 2.1.2) Well investigate what may cause the problem.
from debase.
I've found one more cause of the performance degradation: https://bugs.ruby-lang.org/issues/10511#note-11
from debase.
I've found one more cause of the performance degradation: https://bugs.ruby-lang.org/issues/10511#note-11
The problem is fixed now (https://bugs.ruby-lang.org/issues/10511#note-23)
I've tried both simple benchmark I've created and debase-slow-assets and it works ok for me.
Please test and report if you still see the problem
from debase.
Thanks, it's resolved !
On my test app :
ruby 2.0.0 : 350ms
ruby 2.1.2 : 540ms
ruby 2.1.4 : 2165ms
ruby-2.2-head (2014-12-11) : 400ms
from debase.
wonderful!!! So, I'm closing the ticket.
If anyone will find other situations where debugging is slower please file a new ticket with test to reproduce the problem.
from debase.
Related Issues (20)
- migrate tests to GHA HOT 1
- Debase gem not installing on MacOS Ventura and M1 HOT 2
- Debase failing to install on vscode Jekyll container HOT 1
- Failed to install in ruby docker image (vm_insnhelper.h missing) HOT 2
- Symbol not found: _rb_cObject on M1 Mac HOT 1
- Failed to install debase on Windows 10: is the new version for ruby-3.2.2 not releasing yet? HOT 3
- Deprecation warning: warning: $SAFE will become a normal global variable in Ruby 3.0 HOT 8
- Hash variables as string? HOT 2
- Ruby 2.7.1 compatibility HOT 4
- Won't install with ruby 2.6.6 on macOS Big Sur HOT 12
- ERROR: Failed to build gem native extension - Mac(Catalina)+RVM(ruby 2.5.8) HOT 5
- 0.2.4.1 and 0.2.5.beta Fail to build on macOS Catalina 10.15.7 HOT 15
- Ruby 3.0.0 compatibilty HOT 10
- Missing tags for 0.2.4 and 0.2.4.1 release HOT 1
- Ruby 3.0.2 compatibilty HOT 11
- Ruby 3.1 compatibility issue HOT 5
- Debugger stops only on 1st breakpoint inside a Fiber block and ignores all subsequent ones
- debase failing to install on Mac HOT 1
- Failed to install Debase HOT 7
- Debbuger steps into internal kernel in ruby 3.x
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debase.