From z Mon Dec 04 09:26:42 2000
Received: from maguro.epr.com ([198.3.162.27]) by exchange.epr.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21)
	id WNKA3AZ3; Mon, 4 Dec 2000 00:23:37 -0800
Received: from magrathea.epr.com (firewall-user@magrathea.epr.com [198.3.160.1])
	by maguro.epr.com (8.9.3/8.9.3) with ESMTP id AAA03900
	for <sweeks@intertrust.com>; Mon, 4 Dec 2000 00:27:29 -0800 (PST)
Received: (from uucp@localhost) by magrathea.epr.com (8.9.3/8.7.3) id AAA25057 for <sweeks@intertrust.com>; Mon, 4 Dec 2000 00:27:28 -0800 (PST)
Received: from nodnsquery(199.222.69.4) by magrathea.epr.com via smap (V5.5)
	id xma024977; Mon, 4 Dec 00 00:26:49 -0800
Received: from clairv.com (IDENT:root@pc246.edi.nunet.net [199.249.165.246])
	by mail.acm.org (8.9.3/8.9.3) with ESMTP id DAA49176
	for <sweeks@acm.org>; Mon, 4 Dec 2000 03:26:47 -0500
Received: from simon.cs.cornell.edu (simon.cs.cornell.edu [128.84.154.10])
	by clairv.com (8.9.3/8.9.3) with ESMTP id CAA28785
	for <MLton@sourcelight.com>; Mon, 4 Dec 2000 02:26:45 -0600
Received: from sundial.cs.cornell.edu (sundial.cs.cornell.edu [128.84.96.115])
	by simon.cs.cornell.edu (8.9.3/8.9.3/R-3.1) with ESMTP id DAA25689
	for <MLton@sourcelight.com>; Mon, 4 Dec 2000 03:26:44 -0500 (EST)
Received: from hoho.cs.cornell.edu (hoho.cs.cornell.edu [128.84.96.89])
	by sundial.cs.cornell.edu (8.9.3/8.9.3/M-3.2) with ESMTP id DAA10478
	for <MLton@sourcelight.com>; Mon, 4 Dec 2000 03:26:43 -0500 (EST)
Received: from localhost (fluet@localhost)
	by hoho.cs.cornell.edu (8.9.3/8.9.3/C-3.0) with SMTP id DAA24986
	for <MLton@sourcelight.com>; Mon, 4 Dec 2000 03:26:43 -0500 (EST)
X-Authentication-Warning: hoho.cs.cornell.edu: fluet owned process doing -bs
Date: Mon, 4 Dec 2000 03:26:42 -0500 (EST)
From: Matthew Fluet <fluet@CS.Cornell.EDU>
Reply-To: Matthew Fluet <fluet@CS.Cornell.EDU>
To: MLton@sourcelight.com
Subject: Re: jump tables and cases
In-Reply-To: <200012040816.CAA08363@nimrod.clairv.com>
Message-ID: <Pine.SOL.3.95.1001204031809.7494B-100000@hoho.cs.cornell.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on 
	eponym.sweeks.com
X-Spam-Level: 
X-Spam-Status: No, hits=-100.0 required=3.0 tests=AWL,USER_IN_WHITELIST 
	autolearn=no version=2.60


> 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.

