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

D Richard Felker III dalias at aerifal.cx
Tue Feb 26 04:28:17 CET 2002


On Tue, Feb 26, 2002 at 02:39:56AM +0100, Arpi wrote:
> anyway 2: gcc and other c compilers compile switch {...} to function pointer
> array and indexes in it at the pace of your switch(). so i can't see why
> is your version faster?

actually, from my experience, this is only done when the type you're
switching on is (maybe only unsigned) char and there are sufficiently
many cases to make fundtion pointers worth the extra overhead beyond
the 'dumb' implementation (which i assume would be O(log(n))
comparisons organized in a binary tree).

rich




More information about the MPlayer-dev-eng mailing list