• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Ruby slowdown

Scheduled Pinned Locked Moved Developers' Forum
7 Posts 5 Posters 389 Views
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 26 Oct 2011, 20:19

    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
    • D Offline
      Dan Rathbun
      last edited by 26 Oct 2011, 20:40

      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 26 Oct 2011, 20:45

        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 26 Oct 2011, 20:57

          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
          • T Offline
            TIG Moderator
            last edited by 26 Oct 2011, 22:14

            Printing to the console will slow things greatly...

            TIG

            1 Reply Last reply Reply Quote 0
            • D Offline
              Dan Rathbun
              last edited by 27 Oct 2011, 01:11

              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
              • T Offline
                thomthom
                last edited by 27 Oct 2011, 06:41

                @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
                1 / 1
                • First post
                  1/7
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement