Is 'for' better in Vxworks ?

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

Reply to
karthikbalaguru
Loading thread data ...

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

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

Reply to
Wilco Dijkstra

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.