Jump to content

How to optimise this code?


kaiserhaz

Recommended Posts

@Matteo Thanks. I'll have a look at that.

@Ruchir In your opinion, would the many 'if's affect the performance? I was specifically concerned with that because at almost each loop, there are a minimum of 4 conditions to test. In hardware terms, I'd have to use comparator blocks, and I'd rather save cost than using 4 of them.

Link to comment
Share on other sites

my initial suggestion was if you could eliminate use of "wait" statement, that would definitely increase your run time performance and secondly 'if`s ' statement doesn't affect much in model activity, but yes, if you ask for this to embedded programmer. As every `if`s' break down to branches in assembly code and each "branch True" and "branch false" will have different cycle consume by CORE. So to improve performance programmer should predict flow in terms of utilization and provide condition in IF statement.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...