[MPlayer-dev-eng] Re: [PATCH] Development (Was: Clean up

Daniel Egger degger at fhm.edu
Tue Feb 26 16:22:49 CET 2002


Am Die, 2002-02-26 um 15.22 schrieb Michael Niedermayer:

> > Actually the dumb implementation is O(n). I've not seen a compiler which
> > does partitioning on the switch-type.

> well, indeed gcc is smarter then most of the ppl in this thread ;)
> it uses a jump table which is O(1)

Great. However this works for your example because gcc knows which
types are aliased and what to do with them and is not likely to happen
generally, across platforms and different compilers.

This is still subobtimal even for your case because jumping is likely
to generate bubbles in the stream of superscalar processors pipelines,
it better used conditional moves instead or at maximum a single tap
jumping carpet. Also your example (or better the object file) is quite
a cache and memory hog due to the need of lots of tableentries and
alignment for very small functions.

In theory you're right though. If the compiler would do it that way
on all systems my change would be totally unnecessary but it didn't 
and on my system still doesn't. 

-- 
Servus,
       Daniel




More information about the MPlayer-dev-eng mailing list