[Liboil] Simple scalar operations in ORC possible?

David Schleef ds at entropywave.com
Wed Mar 9 11:01:20 PST 2011


On Tue, Mar 08, 2011 at 06:58:56PM -0800, Nghia Ho wrote:
> Thanks for that. I've been playing around with it a bit and noticed some 
> possible short comings, probably due to my lack of knowledge. It seems every 
> time you call the orc generated function there is some overheard that makes it 
> perform no better than straight C code for simple stuff. Like for example this 
> function that adds a scalar value to an array of float.
> 
> .function add_scalar
> .dest 4 dst float
> .source 4 src float
> .floatparam 4 val
> addf dst, src, val
> 
> is slower then simply doing something like
> 
> for(int i=0; i < N; i++) 
>       data[i] += val;
> 
> An example of the execution time for 100,000 loops are:
> 
> orc: 26.264 ms
> normal: 0.47 ms

Orc compiles the code the first time you execute it.  So I'm not
surprised at this result, if you only took one measurement.



David




More information about the Liboil mailing list