Giter Site home page Giter Site logo

Comments (20)

os97673 avatar os97673 commented on August 10, 2024

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.

mbasset avatar mbasset commented on August 10, 2024

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.

anatolyspektor avatar anatolyspektor commented on August 10, 2024

+1 experience the slowdown with ruby 2.1.4

from debase.

os97673 avatar os97673 commented on August 10, 2024

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.

mbasset avatar mbasset commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

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;

  •   const VALUE old_recursive = rb_threadptr_reset_recursive_data(th);
    int state = 0;
    th->state = 0;
    th->errinfo = Qnil;
    
    @@ -355,6 +356,7 @@
    terminate:
    th->trace_arg = 0;
    th->vm->trace_running--;
  •   rb_threadptr_restore_recursive_data(th, old_recursive);
    
    if (state) {
    if (pop_p) {
    

from debase.

mbasset avatar mbasset commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

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.

mbasset avatar mbasset commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

Need a test project to work with :(

from debase.

Olivier4murs avatar Olivier4murs commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

I've created https://bugs.ruby-lang.org/issues/10511

from debase.

os97673 avatar os97673 commented on August 10, 2024

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.

Olivier4murs avatar Olivier4murs commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

I've found one more cause of the performance degradation: https://bugs.ruby-lang.org/issues/10511#note-11

from debase.

os97673 avatar os97673 commented on August 10, 2024

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.

Olivier4murs avatar Olivier4murs commented on August 10, 2024

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.

os97673 avatar os97673 commented on August 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.