Forums

Is 'for' better in Vxworks ?

Started by karthikbalaguru October 18, 2007
Hi,

How many cycles does memcpy require in VxWorks w.r.t Arm Processor.

Is 'for' better compared to 'memcpy' in VxWorks ? Any ideas ?

Thx in advans,
Karthik Balaguru

"karthikbalaguru" <karthikbalaguru79@gmail.com> wrote in message 
news:1192705213.555105.141410@k35g2000prh.googlegroups.com...
> Hi, > > How many cycles does memcpy require in VxWorks w.r.t Arm Processor.
Although some RTOSes supply their own variants, memcpy is part of the compiler and libraries, and it is typically best to use the latter. If you chose a good compiler you simply do not have to worry about this. How fast memcpy is depends a lot on the particular implementation chosen, the goals (codesize, performance), the alignment and size of the data you are copying and last but not least the CPU used and its memory system ("ARM" is nowhere near specific enough).
> Is 'for' better compared to 'memcpy' in VxWorks ? Any ideas ?
Memcpy is best implemented in highly optimised assembler copying 16+ bytes per iteration, taking less than 1 cycle per byte copied. A "for" loop copying one byte at a time is about 10 times as slow... It's best to do some benchmarking yourself with the kind of copies you need. Wilco