add_group slow on mac

Re: add_group slow on mac

Postby Dan Rathbun » Sun Jan 29, 2012 2:15 pm

Bummer... definately the problem is in the C++ code.
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: add_group slow on mac

    Postby jhauswirth » Mon Jan 30, 2012 7:18 pm

    Looking at the add_group Ruby code, its the same on both platforms.
    One reason (don't know if this is true) it could be slower on the Mac
    is the notifications that are sent around could be updating the Mac
    UI, like the component browser. This may be more efficiently done on
    the PC.

    Also, the same code (duplicate code/cut-n-pasted it looks like) that
    I fixed in the C++ API was also being used in the Ruby code.
    The bug report only mentioned the C++ API, so that's what got fixed.
    0

    jhauswirth 
     

    Re: add_group slow on mac

    Postby thomthom » Mon Jan 30, 2012 7:29 pm

    jhauswirth wrote:Looking at the add_group Ruby code, its the same on both platforms.
    One reason (don't know if this is true) it could be slower on the Mac
    is the notifications that are sent around could be updating the Mac
    UI, like the component browser. This may be more efficiently done on
    the PC.


    I have noticed that if you use Sketchup.status_text within a loop it will be very slow under OSX. It seems that the UI is forcefully freshened all the time, while on Windows you get "white-out" and the UI stops updating - but completes the loop much much faster.

    But if it is the UI that slows things down, then running the test with start_operation and disable_ui argument set to true, should show a good performance increase, right?
    0
    Thomas Thomassen — SketchUp Monkey & Coding addict
    List of my plugins and link to the CookieWare fund
    User avatar
    thomthom 
    PluginStore Author
    PluginStore Author
     

    Re: add_group slow on mac

    Postby Dan Rathbun » Tue Jan 31, 2012 1:29 am

    @John: thanks for taking a look at this, and "weighing in."

    @GWD: Are all these groups to be added REALLY have all the same objects (like the example,) and just have a different location (transform) ?
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: add_group slow on mac

      Postby GWD » Tue Jan 31, 2012 6:34 am

      Dan Rathbun wrote:@John: thanks for taking a look at this, and "weighing in."

      @GWD: Are all these groups to be added REALLY have all the same objects (like the example,) and just have a different location (transform) ?


      Dan,

      No this is just a quick test that reproduce the problem. We have at this moment 2 totaly different script which have this problem.
      0

      GWD 
      PluginStore Author
      PluginStore Author
       

      Re: add_group slow on mac

      Postby GWD » Tue Jan 31, 2012 10:32 am

      thomthom wrote:
      jhauswirth wrote:Looking at the add_group Ruby code, its the same on both platforms.
      One reason (don't know if this is true) it could be slower on the Mac
      is the notifications that are sent around could be updating the Mac
      UI, like the component browser. This may be more efficiently done on
      the PC.


      I have noticed that if you use Sketchup.status_text within a loop it will be very slow under OSX. It seems that the UI is forcefully freshened all the time, while on Windows you get "white-out" and the UI stops updating - but completes the loop much much faster.

      But if it is the UI that slows things down, then running the test with start_operation and disable_ui argument set to true, should show a good performance increase, right?


      I tested it with start_operation and it as no effect!
      0

      GWD 
      PluginStore Author
      PluginStore Author
       

      Re: add_group slow on mac

      Postby GWD » Tue Jan 31, 2012 11:29 am

      I just did some testing with adding components instead of groups (see script below). And the result is shokking. Placing 600 component give about the same time as the 600 groups 0.7 sec on PC and 27 sec on MAC. BUT after the script ended the MAC keep on showing the busy icon for very long time. More than 5 minutes (then i killed sketchup). I did the same test on mac with different number of components and this are the results:

      50 components 0.29 sec running script 17 sec busy icon after script
      100 components 0.85 sec running script 35 sec busy icon after script
      200 components 3.8 sec running script 2 min 25 sec busy icon after script
      300 components 7.6 sec running script more than 5 min sec busy icon after script
      600 components 27 sec running script more than 5 min busy icon after script

      Code: Select all
      require 'sketchup'
      UI.menu("PlugIns").add_item("bugMAC Test2") {
      model = Sketchup.active_model
      entities = model.entities
      puts '- Start test1 add_group bug on MAC -'
      start = Time.now
      for n in 1..600 do
         newdef = model.definitions.add      
         newdef.name = n.to_s
         point1 = Geom::Point3d.new(n*10,0,0)
         newdef.entities.add_cpoint point1
         pt = Geom::Point3d.new 0,0,0
         trans = Geom::Transformation.new pt
         i = model.entities.add_instance(newdef, trans)
         i.make_unique   
      end
      puts 'Total time: ' + (start - Time.now).to_s 
      }
      0

      GWD 
      PluginStore Author
      PluginStore Author
       

      Re: add_group slow on mac

      Postby GWD » Mon Feb 06, 2012 4:38 pm

      No solutions?
      0

      GWD 
      PluginStore Author
      PluginStore Author
       

      Re: add_group slow on mac

      Postby Dan Rathbun » Mon Feb 06, 2012 5:09 pm

      Not surprising that it takes the same time to add groups and components, because a group is a special type of component, that also has a ComponentDefinition (whose group? attribute is true.)

      The extra time, likely comes from adding all that new stuff to the Component browser. (guessing, here.)

      Close any unneeded toolwindows, especially the Object browser. And use an operation with the disable_ui flag set.

      That's all we can say. I guess John indicated that there were UI issues with the Mac edition. (I'm not sure if he said the SDK updates did, or did not make it into the last build... he was a bit ambiguous. But internal politics, ya know....)

      You can always file a bug report. The more people that scream...
      0
        I'm not here much anymore. But a PM will fire email notifications.
        User avatar
        Dan Rathbun 
        PluginStore Author
        PluginStore Author
         

        Re: add_group slow on mac

        Postby GWD » Mon Feb 06, 2012 5:52 pm

        Dan, where can i post a bug report?
        0

        GWD 
        PluginStore Author
        PluginStore Author
         

        Re: add_group slow on mac

        Postby Dan Rathbun » Mon Feb 06, 2012 10:37 pm

        GWD wrote:Dan, where can i post a bug report?

        Open Sketchup... pulldown the Help menu, choose "Contact Us" ...

        ... your browser will open, to the Google Sketchup Contact page.

        Use the "Bug Report" link, to bring up the form, and fill it out.
        0
          I'm not here much anymore. But a PM will fire email notifications.
          User avatar
          Dan Rathbun 
          PluginStore Author
          PluginStore Author
           

          Re: add_group slow on mac

          Postby GWD » Tue Feb 07, 2012 8:23 am

          I submitted a bug report.
          0

          GWD 
          PluginStore Author
          PluginStore Author
           

          Re: add_group slow on mac

          Postby Dan Rathbun » Thu May 24, 2012 4:03 am

            Good news for Mac users. This issue has been reported as fixed in the 8.0M3 release.

            see: SketchUp Release Notes

            and get the latest MR at the SketchUp Downloads page.
            0
              I'm not here much anymore. But a PM will fire email notifications.
              User avatar
              Dan Rathbun 
              PluginStore Author
              PluginStore Author
               

              Re: add_group slow on mac

              Postby th3lurker » Thu May 24, 2012 9:05 am

              I would have loved it if they fixed add_face too. I've found workarounds, so i don't need it now, but still.
              0

              th3lurker 
               

              Re: add_group slow on mac

              Postby GWD » Fri Jun 01, 2012 4:01 pm

              The problem isn't fixed at all on mac. I did the test i posted before with the new version. On mac the script runs 250% slower on the new version. On pc the script runs 300% faster on the new version!
              0

              GWD 
              PluginStore Author
              PluginStore Author
               

              Re: add_group slow on mac

              Postby thomthom » Fri Jun 01, 2012 4:23 pm

              GWD wrote:The problem isn't fixed at all on mac. I did the test i posted before with the new version. On mac the script runs 250% slower on the new version. On pc the script runs 300% faster on the new version!

              Can you post your test code?
              0
              Thomas Thomassen — SketchUp Monkey & Coding addict
              List of my plugins and link to the CookieWare fund
              User avatar
              thomthom 
              PluginStore Author
              PluginStore Author
               

              Re: add_group slow on mac

              Postby GWD » Fri Jun 01, 2012 4:50 pm

              thomthom wrote:
              GWD wrote:The problem isn't fixed at all on mac. I did the test i posted before with the new version. On mac the script runs 250% slower on the new version. On pc the script runs 300% faster on the new version!

              Can you post your test code?


              You can find the code on page 3
              0

              GWD 
              PluginStore Author
              PluginStore Author
               

              Re: add_group slow on mac

              Postby driven » Wed Dec 19, 2012 10:27 pm

              GWD wrote:You can find the code on page 3

              Hi,
              after a lot of digging, it appears that your test code will run in 0.8[1..3] seconds on both Snow Leopard and Mountain Lion with free or pro SU v6, v7 or v8, UNLESS you have either of these in your preference list
              <string>OutlinerController</string>
              <string>ComponentGBrowserController</string>

              these have no ill effect, but add either of the others and you beach-ball...
              <key>OpenInspectors</key>
              <array>
              <string>PagePanelController</string>
              <string>LayerPanelController</string>
              <string>StyleBrowserController</string>
              <string>SoftenPanelController</string>
              <string>EntityInfoController</string>
              </array>

              They actually fork the main Thread into a timer loop to make the thumbnails and will do that even if the ruby has run before you open the Inspector. i.e run test code without, then zoom, orbit, make new geometry, etc... turn on 'Components' or 'Outliner' and you'll get a beach-ball.
              If 'Components' is run first 'Outliner' opens straight away.

              john
              0
              learn from the mistakes of others, you may not live long enough to make them all yourself...

              driven 
              PluginStore Author
              PluginStore Author
               

              SketchUcation One-Liner Adverts

              by Ad Machine » 5 minutes ago



              Ad Machine 
              Robot
               

              Previous


               

              Return to Developers' Forum

              Who is online

              Users browsing this forum: No registered users and 6 guests

              Visit our sponsors: