Script execution time

Hi there

I’m currently building scripts to export model analysis data…
and I’m facing to long execution time (I’m fresh in this, so may be it’s in fact standard)
My question is:
What section is consuming time?
-Creating arrays: all_items=[]
-Selecting items: all_item=se.get_all_content_by_type(type)
-loops
I need about 20 to 30 min to run collecting SFE or EI…
The full work should include 66 extractions. Is there any trick to save time?
Thanks for any help
Thierry

Hello @Thierry_Poupon ,
I think @ArnaudDieumegard give some hints about this

I would say that you could optimize selecting items such as suggested in the above post and optimize loops that could take also some time.

Best regards,

Sophie

@Thierry_Poupon should you need help in optimizing your scripts/finding out what’s causing the issue: we provide professional services. Just an option for you to consider, maybe, and potentially one of the ways to give back to the community building Python 4 Capella!
Stephane LACRAMPE
Obeo Canada

@Sophie_Plazanet
Thanks for the reminder :slight_smile:
I would like to save scripts as well:
So far, if I want to see useless SFE (example) because the convoy nothing, I have to list SFE and SFE with EI, at the moment my script does not give empty SFE in the second list. So I append or joint the lists with Excel…
I understand that at assembly time, I should make some groups by browse: all that need FE; EI; EIE or any object class…
and then run loop as much as possible once.
Again thanks for your help
Best regards
Thierry