I submitted a bug report.
Posts made by GWD
-
RE: Add_group slow on mac
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 scriptrequire '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 }
-
RE: Add_group slow on mac
@thomthom said:
@jhauswirth said:
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
anddisable_ui
argument set to true, should show a good performance increase, right?I tested it with start_operation and it as no effect!
-
RE: Add_group slow on mac
@dan rathbun said:
@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.
-
RE: Add_group slow on mac
@dan rathbun said:
WoW! Excellent test report. Shows that the Mac still has a problem.
I wonder if the difference has to do with Ruby.? The Mac is still running the initial release of v1.8.5, and the PC was updated to v1.8.6-p287.
There is a thread on how to point the symbolic references for Sketchup Ruby to a "normal" full Ruby install elesewhere on the Mac's harddrive. (You need to backup the current links, so you can switch back if necessary. Perhaps a shell script?)
I'd be interested in seeing the comparison for the Mac, running v1.8.5-p0 and v1.8.6-p287, ... (and perhaps even the latest patchlevel for v1.8.7)
And here are the results for ruby 1.8.7 on mac:
100 - 0.58 sec
200 - 1.69 sec
400 - 10.55 sec
600 - 33.39 sec
1000 - 147 secAlmost no difference with ruby 1.8.5
-
RE: Add_group slow on mac
@dan rathbun said:
For version 8.0M2,
@unknownuser said:(http://support.google.com/sketchup/bin/static.py?hl)":100134bg]SketchUp Writer C++ API: In earlier versions, ISketchUpGroup::CreateGroup became slower each time it was called. This shouldn't slow down any longer.
I would think that this fix was added into the application code as well.
@Guy: Is your friend's Mac running Sketchup version 8.0M2 ??
We use on Mac and PC the latest version from google's website. (PC 8.0.11752/MAC 8.0.11.751)
I did some more testing:
model = Sketchup.active_model entities = model.entities puts '- Start test1 add_group bug on MAC -' start = Time.now for n in 1..1000 do #changed this setting for the testing g = entities.add_group g.name = n.to_s point1 = Geom;;Point3d.new(n*10,0,0) c = g.entities.add_cpoint point1 end puts 'Total time; ' + (start - Time.now).to_s
Results:
At this moment we use a workaround. Place the groups in a new model (use the multiple documents on MAC), make a component of all the groups. Save this component and insert it in the model and explode it. The biggest problem of this workaround is that it's impossible to close the new temporary model with ruby. A other problem is that is still a lot slower than on PC.
Anybody a solution? -
RE: Add_group slow on mac
@dan rathbun said:
@dan rathbun said:
YUP. On PC,
Sketchup.send_action("save:")
returnsfalse
. I wonder what the standard action is for Mac ?Ok.. it's
Sketchup.send_action("saveDocument:")
(at least it works on PC, and is listed on the Apple site as an action for the NSDocument class.)the Sketchup.send_action("saveDocument:") works on mac!
-
RE: Add_group slow on mac
@thomthom said:
Are you sure it's add_group being slow?
Are you by any chance also using Sketchup.status_text as well? Updating the progress of your script?Do you have a sample script you're testing with?
We use indeed the Sketchup.status_text in our script for updating the progress. But this isn't to problem because the problem also occurs with te following simple script.
Create a model with 1000 solids and run the following script:model = Sketchup.active_model
entities = model.entities
for n in 1..1000 do
g = entities.add_group
g.name = n.to_s
point1 = Geom::Point3d.new(n*10,0,0)
c = g.entities.add_cpoint point1
g.explode
endOn PC this goes fast, on mac this takes a very long time.
-
Add_group slow on mac
I've a script that runs good on my PC. But when my friend uses it on his mac with the same model it's much slower (more than 10x). After a lot of testing to narrowed down the problem, adding a group with add_group on a big model is much slower on mac than on pc. How can we avoid this problem?
-
RE: UI doesn't update
@thomthom said:
None of that will work - when a ruby script starts to do lots of work the UI will not update and not become responsive. There is no API methods that will avoid that.
Under OSX that statusbar will still update, but under Windows it will not. In some of my heavy processing plugins, such as CleanUp, I do a Win32 API call to PeekMessage to make the UI update - but the user still won't be able to interact with it.
It's a very annoying behaviour of SketchUp that's been a source of complaints for a long time. Many developers has tried to find ways around it, threads etc without any luck. Fredo got a system with timers, that somewhat prevents the window from completely turning unresponsive, but it cannot be applied to all tasks and it add to the total processing time.
Thanks thomthom, now i know it's a SU problem.
-
UI doesn't update
In several of my scripts sometimes the UI doesn't update during a part of the script execution. In the beginning the UI update correctly after a while it doesn't update anymore but the script is still running. After a while the scripts ends and everything is back to normal and the script has done what it should do. But the script is much slower when the UI doesn't update! How can I avoid this problem?
regards,
Guy
-
RE: .dll accessing - how to?
I want to access the functions of the Skp2AcadHlr.dll, because i want to export a hiddenlineremovel from within a ruby script. Can somebody help me?
-
RE: Ruby autosplit edge?
I found a very easy way to auto split crossing edges. Create all edges inside a group when all edges are added to the group, explode the group. Sketchup will automatic split all crossing edges.
-
RE: Bounding box of a nested solid
What i need is a quick check if the sectionplane cuts the solid. Because the .intersect_with is a very slow function i want first to check if solid wil be sectioned by the sectionplane to speed up the script. And the check with the bounding box works good except for nested solids. Anybody a tip for solving my problem?
-
Bounding box of a nested solid
Is there a way to get the 'real' bounding box of a nested solid? I need this bounding box to get the min z and the max z of the solid. But i need the real z value with all transformation. I tried to do the transformation to a point created from the max x,y,z value of the bounding box but this gives a wrong result. And it's not possible to do a transformation of a bounding box.
-
Open sketchup 2 times
Since a short time i have problems with opening sketchup 2 or more times. The second instance has no anti-aliasing and is very slow. Anybody an idea what the problem is?
-
Resize DC with ruby
I'm trying to resize a DC with a ruby script. But the result is very strange.
I use the .set_last_size function, and the DC size changes but not to the right size.
-
RE: [plugin] realSection v0.6 Béta (Updated 9/8/2014)
@edson said:
thanks for this most useful plugin!
a question: does anyone know were one can get textures with the hatch patterns normally used in section drawings?
Look in the demo skp file and you find very nice section materials.