sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Ruby performance on a Mac... am I just late to the party?

    Scheduled Pinned Locked Moved Developers' Forum
    26 Posts 4 Posters 3.0k Views 4 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.
    • T Offline
      todd burch
      last edited by

      I run makefaces on SU 8 on Windows XP against an 11 x 41 grid of wire frame rectangles. Speed = 0.23 seconds for 451 faces. Not too shabby.

      I run SU 8 on Mac 10.5.8 on the same grid (and the same scripts). Speed = 23.48 seconds. 100 times as long. No other processes running, no other scripts even loaded.

      Oh, Windows is running on my Mac under VMware Fusion.

      Did I miss the memo that SketchUp Ruby performance on a Mac sucks? I've opened a bug report.

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

        Shouldn't be such difference, no.

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

        1 Reply Last reply Reply Quote 0
        • jeff hammondJ Offline
          jeff hammond
          last edited by

          yeah, similar findings here..

          15.89 seconds for 451 faces... su8/10.6.6

          (though generate faces via context click when tools on surface is installed gives nearly instantaneous results)

          dotdotdot

          1 Reply Last reply Reply Quote 0
          • T Offline
            todd burch
            last edited by

            Thanks for the confirmation Jeff. I did have a couple runs same as yours.

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

              My Windows box:

              @unknownuser said:

              makefaces.rb: Copyright 2004-2006 Burchwood USA.
              Version 1.2 May 14,2006.

              There were 954 selected items.

              There were 0 non-Edge selected items.
              There were 954 Edges selected.

              There were 451 face(s) added.
              The process lasted: 0.378 Second(s).

              I'll see if I can get my Mac hooked up (finally)

              (btw, makefaces would run even faster if it didn't use .typename.

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

              1 Reply Last reply Reply Quote 0
              • T Offline
                todd burch
                last edited by

                Yes, that's not all it needs.... It's getting a rewrite too.

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

                  Might the diff be your Mac is running Ruby 1.8.5 initial release (2006-08-25), and the PC edition is running 1.8.6-p287 (which I notice is nearing 2.5 years old.) ??

                  You Mac guys need to find a way to get a newer Ruby Framework installed under Sketchup.

                  I'm not here much anymore.

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

                    @dan rathbun said:

                    Might the diff be your Mac is running Ruby 1.8.5 initial release (2006-08-25), and the PC edition is running 1.8.6-p287 (which I notice is nearing 2.5 years old.) ??

                    But wouldn't you then get a speed difference in SU on Windows prior to SU8? Which was running 1.8.0? It's a difference of 100 times, something has to be wrong.

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

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

                      Well run the same tests on 7.x under Ruby 1.8.0 and we'll have numbers to talk about.

                      I haven't seen the test code.. so I don't know what to look for in the Ruby ChangeLogs.

                      I'm not here much anymore.

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

                        @dan rathbun said:

                        I haven't seen the test code.. so I don't know what to look for in the Ruby ChangeLogs.

                        Basically iterates the selection and for each edge: edge.find_faces

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

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

                          Well there is the diff of Objective-C on the Mac, and C++ on Windows.

                          And as we proved for .. in seems to run twice as fast as each.. but it's a platform difference.

                          Hmmm... may be that sometime after 1.8.5 (initial) they may have increased the default Ruby starting stack size. (I seem to remember something about that.)

                          But.. I also thot in other tests, people were saying that Macs ran faster. They are always calling the PC opsys "WinDOSE".

                          I'm not here much anymore.

                          1 Reply Last reply Reply Quote 0
                          • jeff hammondJ Offline
                            jeff hammond
                            last edited by

                            @dan rathbun said:

                            You Mac guys need to find a way to get a newer Ruby Framework installed under Sketchup.

                            i've tried a few things (putting an alias in place of the sketchup ruby.. copying the entire Ruby.framework from os x in place of sketchup.app's Ruby.framework, plus a couple of other things)

                            sketchup won't launch..

                            fwiw, sketchup's ruby.frameworks is ~1MB in size where as the osx ruby.frameworks is over 200MB..

                            i don't mind poking around and experimenting with stuff but since we're dealing with the system library here, i'd rather not poke too much without having a clue about these things πŸ˜„..

                            i would think that google would have tied into the system ruby if it were as easy as something i'd be able to do.. there must be something else going on.. i mean, a lot of the su team seem to be mac users and i can't imagine why they'd keep an outdated version of ruby in there without some sort of reasoning?

                            dotdotdot

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

                              @dan rathbun said:

                              And as we proved for .. in seems to run twice as fast as each.. but it's a platform difference.

                              ?
                              Platform difference?

                              for .. in runs faster because it doesn't create a new local scope and new variables. .each creates new objects for each iteration, which is more expensive.

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

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

                                Just ran makefaces on my MacMini OSX 10.5

                                ` makefaces.rb: Copyright 2004-2006 Burchwood USA.
                                Version 1.2 May 14,2006.

                                There were 954 selected items.

                                There were 0 non-Edge selected items.
                                There were 954 Edges selected.

                                There were 451 face(s) added.
                                The process lasted: 2.175241 Second(s).`

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

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

                                  With pb.update

                                  ` makefaces.rb: Copyright 2004-2006 Burchwood USA.
                                  Version 1.2 May 14,2006.

                                  There were 954 selected items.

                                  There were 0 non-Edge selected items.
                                  There were 954 Edges selected.

                                  There were 451 face(s) added.
                                  The process lasted: 2.502378 Second(s).`

                                  Without pb.update

                                  ` makefaces.rb: Copyright 2004-2006 Burchwood USA.
                                  Version 1.2 May 14,2006.

                                  There were 954 selected items.

                                  There were 0 non-Edge selected items.
                                  There were 954 Edges selected.

                                  There were 451 face(s) added.
                                  The process lasted: 0.433242 Second(s).`

                                  So the lag is due to something in Progressbar.update

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

                                  1 Reply Last reply Reply Quote 0
                                  • jeff hammondJ Offline
                                    jeff hammond
                                    last edited by

                                    fwiw, i remember when chrisF was making shapebender.. it was super fast at first but then he added progress bar to it and it slowed to a crawl.. i mentioned it to him but i don't think he believed me πŸ˜„

                                    dotdotdot

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

                                      It all boils down to Sketchup.set_status_text or Sketchup.status_text=. Remove them and the script runs fast.

                                      It seems that OSX always updates the UI even when plugins do heavy processing. As oppose to Windows where the UI stops responding.

                                      So I am guessing the lags comes from that and one should avoid updating the statusbar too often.

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

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

                                        t=Time.now; 1000.times { |i| Sketchup.status_text = "Foo #{i}" }; puts Time.now - t

                                        OSX: 2.08987 (You see the statusbar update for each iteration.)
                                        Windows: 0.114 (You do see the statusbar update, but the text is a blur as it's much faster.)

                                        Conclusion: Sketchup.status_text= has very poor performance under OSX!

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

                                        1 Reply Last reply Reply Quote 0
                                        • jeff hammondJ Offline
                                          jeff hammond
                                          last edited by

                                          hmm.. makes me wonder if those two lines are affecting performance of other plugins i have..

                                          here's a list of all the rubies i have which include those lines..

                                          (search term shown in top-right of finder window)

                                          screen 2011-01-30 at 1.39.57 PM.jpg

                                          that said, the only one of those listed rubies that i think could be sped up would be jointPushPull (and shapebender as i mentioned earlier).. if i run it on a more complex surface, it takes a while to complete but i just figured that's how it was.. maybe it's speed-upable on mac?

                                          (not saying that the others aren't affected.. it's just that i use JPP a lot and/or i'm feeding it more complex tasks where as the others that i use are more simple)

                                          dotdotdot

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

                                            @unknownuser said:

                                            hmm.. makes me wonder if those two lines are affecting performance of other plugins i have..

                                            It's a good possibility if they call these methods from within loops.
                                            I will have to profile some of my plugins under OSX.

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

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

                                            Advertisement