Ruby script excution time in SU 2018 is much slower than in SU2017

I tested the very same .rb scripts both in SU2018 and SU2017.
The exceution times in milliseconds
SU2018 SU2017

I tested the very same .rb scripts both in SU2018 and SU2017. (on the same computer)
The exceution times in milliseconds
SU2018 SU2017
20139 1994
17204 2917
3722 981
229 576

WindowsSlowSelectionWorkaround.bat was run for SU2018.

Any guess why?

You don’t say what scripts or what they do, so it is impossible to guess.

1 Like

The first script just writes 4 strings at given position
using .add_3d_text method and Geom::Transformation. method.
(anyway I think so it is very slow even on SU2017)

The second one is a complex demo script for my parametric model generation
I try to upload the result of script2script2.skp (836.4 KB)

The third one is a simple demo script

The fourth one is very simple just rescales and existing model.
using Geom::Transformation.scaling(scaleX,scaleY,scaleZ) method
My guess it was faster in SU2018 due to the fact the model was already in the cache.

Do you have any other extensions on either version that might be interfering with the test?

Also are all other factors the same, e.g. what inspector windows are open (especially outliner and components)?


The resulting SketchUp model really doesn’t tell us anything about the Ruby code that generated it! I’m not trying to pry into what you may regard to be intellectual property, only saying there are lots of things that can slow down execution and no way to guess what your code is actually doing.

making components or adding materials could both slow v18 down as both have new ‘features’…

I’m not aware of any other new API features that may have an effect…

try both with the DC extension disabled…


Exactly the same extensions are installed.
( and su_utilities.rb )

Can you share one of the demo scripts so we could see if we get the same results on different machines?

One part of the problem that I consider the srcripts as my intelectual property.
Another part is that the code is more than 2600 lines already.
I do not think so that you would have enough time to analyze all my coding.

I will try to restructure the first script (3d text) into a traditional ruby script.
It should be around 10-16 lines. It could be understood and tested much more easily.

I have not changed anything in this regard on the factory defaults.

Are you wrapping your geometry generation inside an undo operation with the GUI switched OFF ?

1 Like

Thank you!!!

at the beginning of the script

model = Sketchup.active_model
model.start_operation(‘Generate Mymodel’, true)

thousand lines of code

at the end


solved the problem.
The longest script was ready in 268 milliseconds!!!
Actually SU 2018 is even faster a little bit than SU2017.


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.