Jump to content
Sign in to follow this  
juani_c

how to optimize code?

Recommended Posts

suppose I have to calcule this;

y=(((x2-x1)+(x3-x1))/3)+x1;

and I want to know how to break it down in order to have the best code in C. Does anyone know of any good resources for learning how to optimize this kind of tasks?

Share this post


Link to post
Share on other sites
In an equation like this, the time-killer is the division.f

Having this in mind I did a little search and found this;

"Efficient Multiplication and Division Using MSP430"-> http://focus.ti.com/lit/an/slaa329/slaa329.pdf

There is a table on page 7 showing the results from using different methods and there is a big improvement using those described in the app note.

Share this post


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

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.

Sign in to follow this  

×
×
  • Create New...