Re: jump tables and cases

Top Pagina
Bijlagen:
Bericht als e-mail
+ (text/plain)
Delete this message
Reply to this message
Auteur: Matthew Fluet
Datum:  
Aan: MLton
Onderwerp: Re: jump tables and cases

> Didn't we decide to go with binary search for big integer case statements?
> The data from the GNU Eiffel paper seemed pretty convincing that it is often
> much getter and basically never much worse.


O.k. We might consider doing the same thing for cases on words. I have a
program that has a large case statement on a word value, and the resulting
code is a sequence of cmpl/je pairs. I kept seeing that and assumed it
was a by-product of by translation of switch (and hoped it would go away
with a jump table implementation), but I guess it turns out that it's just
what would naturally fall out of the sequence of ifs.

> I was confused initially by this message trying to see what the importance of
> IntInf.int switches was (i.e., BIG integers).


Sorry, I just meant a case statement on an integer with a large number of
cases.