Re: How to accelerate this python file ?
Hi,
The python file joined to this text needs 6 secondes to be executed on my computer in SalomeMeca 12.2.
Can it be accelerated ?
You will get the time used at the end in the Python window.
Sincerely.
Pascal KREZEL
Hi,
You can use python profiler to see which functions take too much time: http://docs.python.org/library/profile.html
See the (non-attached due to size limit) graph generated with gprof2dot: ftp://ftp.cea.fr//incoming/y2k01/salome-forum/systeme_complexe_1.pstats.png
As you can see, the visualisations of the shapes in GEOM takes 38% + 27% of the total time. You should comment them if speed is preferred over visualisation.
You can organize your script in functions to better see which steps take too much time.
Christophe
Thank you for your answer.
In fact, if I avoid the visualisation during the creation of the model, the time is the same when the visualisation is done at the end.
And if I simplify the modelisation of the pipe, it is the same.
So, it is the visualisation of the shapes that takes most of the time, even if these ones are simple.
Pascal
Previously Christophe Bourcier wrote:
Hi,
You can use python profiler to see which functions take too much time: http://docs.python.org/library/profile.html
See the (non-attached due to size limit) graph generated with gprof2dot: ftp://ftp.cea.fr//incoming/y2k01/salome-forum/systeme_complexe_1.pstats.png
As you can see, the visualisations of the shapes in GEOM takes 38% + 27% of the total time. You should comment them if speed is preferred over visualisation.
You can organize your script in functions to better see which steps take too much time.
Christophe
