> >>Are you sure switch makes the same kind of code as above ? I thougth it
> >>made a lot of compare/next steps !
> >>
> >>
> >
> >With any minimally optimizing compiler, yes it does.
> >
> >
> Ok, thanks for the hint, I am quite happy now. This is the final
> argument against the class per bytecode, this can't be done much faster
> as far as I see.
>
> I have just testet gcc with a -S, and with a few cases in the switch, it
> generates the code I feared, but as I add up entries, the code gcc makes
> change to a nice label array, even if not optimizing.

Thanks for checking my optimistic thoughts. Indeed, I had never tested whether
gcc was doing it or not. I'm from the "trust your compiler" school of thought.

Martin


_______________________________________________
glob2-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/glob2-devel

Reply via email to