code speed

Discussion related to "under the hood" OpenMV topics.
pcls1026
Posts: 123
Joined: Tue Aug 22, 2017 1:33 am

code speed

Postby pcls1026 » Fri Apr 24, 2020 5:02 pm

Hi,
I have a lot of PRINT statements in my script. They slow down my execute speed in the IDE. Do the PRINT statements also slow down the execute speed when I run the script without the IDE. (I.E on batteries.) If they do slow the execute speed, can I delete them with a blanket command, or do I need to delete them one by one?
Thanks,
Jim
User avatar
iabdalkader
Posts: 1193
Joined: Sun May 24, 2015 3:53 pm

Re: code speed

Postby iabdalkader » Fri Apr 24, 2020 6:59 pm

pcls1026 wrote:
Fri Apr 24, 2020 5:02 pm
Hi,
I have a lot of PRINT statements in my script. They slow down my execute speed in the IDE. Do the PRINT statements also slow down the execute speed when I run the script without the IDE. (I.E on batteries.) If they do slow the execute speed, can I delete them with a blanket command, or do I need to delete them one by one?
Thanks,
Jim
There will be some processing, the text buffer will just overwrite itself, but it should be faster without the IDE. There's no way for the IDE to remove statements from your script, you could write a function that prints and call it instead and disable just that one function before saving main.py.

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 11 guests