Re: [AD] Faster hsv_to_rgb()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> I tested it (ran through many h,s,v triples and compared with previous
> algorithm), and it seems correct. It's a bit faster, but not as much as
> one would expect: on my computer the new version takes about 95% of the
> time that the old version took.

Yes, the compiler is able to partially optimize the original code.

> I tried one more optimization, replacing the switch by a binary search,
> which took it down to 93-94% of the time of the old version.

I think the performance benefit of this latter optimization is much too small 
to justify the big degradation of readability. And this optimization is 
typically compiler's job.

-- 
Eric Botcazou




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/