sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Ruby slowdown

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 5 Posters 389 Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      joshb
      last edited by

      I've noticed that the performance of my plugin degrades the longer I keep Sketchup open. All I'm doing in my plugin is modifying attribute dictionaries on various entities and coloring and/or showing/hiding based on their attributes. I can close/reopen Sketchup and run the exact same test case and see things perform noticeably faster.

      I realize that my question here is sufficiently vague, but was wondering if anyone had encountered anything like this and/or had any pointers on how to proceed in debugging.

      Some things that I've considered could be going wrong are

      • garbage collection - not quite sure how to debug this
      • undo/redo stack memory consumption - memory seems to be staying constant, and I'm using the start/commit operations on the model to limit undo/redo activity

      Any pointers here would be greatly appreciated.

      Thanks again,
      Josh

      1 Reply Last reply Reply Quote 0
      • Dan RathbunD Offline
        Dan Rathbun
        last edited by

        Force Garbage Collection via: GC.start()

        And saving the model will clear the undo stack.

        I'm not here much anymore.

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          If you're using the Ruby Console for debugging output, SketchUp gets progressively slower the more lines that are added.

          I use either the Ruby Toolbar plugin or an AHK short-cut to clear the Ruby Console.

          Hi

          1 Reply Last reply Reply Quote 0
          • J Offline
            joshb
            last edited by

            I am using the ruby console, maybe thats it.

            Regarding undo/redo, is there any way to disable that using the API? I'm using the start/commit methods to store a single entry on the stack but that single entry still seems to consume as much memory as all of the individual actions would. It would be really nice to either be able to turn that off or to clear the stack manually without forcing a save.

            thanks,
            josh

            1 Reply Last reply Reply Quote 0
            • TIGT Offline
              TIG Moderator
              last edited by

              Printing to the console will slow things greatly...

              TIG

              1 Reply Last reply Reply Quote 0
              • Dan RathbunD Offline
                Dan Rathbun
                last edited by

                We don't have direct control over the undo stack via a Ruby class.

                There is a Registry key that sets max number of undo ops... but I do not think it is exposed to the user via the app's UI. (The default is 100 I think.)

                I'm not here much anymore.

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @tig said:

                  Printing to the console will slow things greatly...

                  That's a good pointer - if you use the Ruby Console to debug then the more you output the more it slows down.

                  I use a small snippet that uses the Win32 API to clear the content of the console in order to keep it responsive. I also use Win32 to output data to DebugView.

                  Thomas Thomassen — SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement