Jump to content

How to optimise this code?

Recommended Posts

Well c/thread is always performance killer... so i would request to you if possible use method with static or dynamic sensitivity.

Like :


if(!vga_controller::fetch_done) {





Share this post

Link to post
Share on other sites

@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.

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now