NOTE: Benchmarks and timings given below are little outdated because article was written back in 2008. Today’s CPUs are faster and memory bandwidth is also higher.<\/em><\/p>
AmiBroker Formula Language (AFL) thanks to its array processing<\/a> model is able to run at the same speed as code written in assembler (i.e. machine code). The following article explains how.<\/p>
gets compiled by AmiBroker to just 8 assembly instructions<\/strong>:<\/p>
Now if you look at
memory benchmarks<\/a> you will see that 2GB\/s is the limit of system memory speed on Athlon x64 (DDR2 dual channel)
And that’s considering the fact that Athlon has superior-to-intel on-die integrated memory controller (hypertransfer)<\/p><\/span>\/\/ benchmark code
\/\/ for accurrate results run it on LARGE arrays -
\/\/ intraday database, 1-minute interval, 50K bars or more)
<\/span>GetPerformanceCounter<\/span>(<\/span>1<\/span>);
for(<\/span>k <\/span>= <\/span>0<\/span>; <\/span>k <\/span>< <\/span>1000<\/span>; <\/span>k<\/span>++ ) <\/span>X <\/span>= <\/span>C <\/span>* <\/span>H<\/span>;
<\/span>"Time per single iteration [s]="<\/span>+<\/span>1e-3<\/span>*<\/span>GetPerformanceCounter<\/span>()\/(<\/span>1000<\/span>*<\/span>BarCount<\/span>); <\/code>