At present, I have code written in C language. I run it on Symbian. But the speed is too slow. How can I optimize it to make it rum faster? Thank you very much.
1.check exactly which functions work slow and optimize them
2.try to optimize algorythm first
3.don't use floating point math, use 32bit memory accesses, don't use div and limit using mul etc etc... dozens of optimization tricks come to my mind, it depends what you're doing
1.check exactly which functions work slow and optimize them
2.try to optimize algorythm first
3.don't use floating point math, use 32bit memory accesses, don't use div and limit using mul etc etc... dozens of optimization tricks come to my mind, it depends what you're doing
Yep i agree. There are many things that can speed up your code. Some are difficult some are realy easy like for ex. doing for-loops backward. It realy depends what app your doing. Check tutorials bout C++ optimization, try some ARM assembly.[/b]
Best regards, Michal Laskowski
 
Tue, 2005-06-21 00:20
Guest (not verified)
Forum posts: 2018
Re: How to optimize code on Symbian?
What do you mean by doing a for loop backwards? How does this increase efficiency?
Forum posts: 1379
C/C++ is fast enough for most things on Symbian, very few things actually need to be assembly optomized.
didster
Forum posts: 205
Best regards,
Michal Laskowski
Forum posts: 27
2.try to optimize algorythm first
3.don't use floating point math, use 32bit memory accesses, don't use div and limit using mul etc etc... dozens of optimization tricks come to my mind, it depends what you're doing
With best regards,
Mirek Czerwiński
Forum posts: 205
2.try to optimize algorythm first
3.don't use floating point math, use 32bit memory accesses, don't use div and limit using mul etc etc... dozens of optimization tricks come to my mind, it depends what you're doing
Yep i agree. There are many things that can speed up your code.
Some are difficult some are realy easy like for ex. doing for-loops backward.
It realy depends what app your doing.
Check tutorials bout C++ optimization, try some ARM assembly.[/b]
Best regards,
Michal Laskowski
Forum posts: 205
.myloop
ADD R1, R1, #1
CMP R1, #255
BNE myloop
and counting from 255 to 0 looks like
.myloop
SUBS R1, R1, #1
BNE myloop
check this site its good source for someone new with ARM.
Best regards,
Michal Laskowski