<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 9.00.8112.16434"></HEAD>
<BODY bgColor=#ffffff text=#000000>
<DIV dir=ltr align=left><SPAN class=089051019-29092011><FONT color=#0000ff
size=2 face=Arial>I should add that my timing was on an overall program, not the
binary-case alone. I am more interested in the performance of whole programs
than in parts that may not significantly add to the time.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=089051019-29092011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=089051019-29092011><FONT color=#0000ff
size=2 face=Arial>Jos</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> users-bounces@racket-lang.org
[mailto:users-bounces@racket-lang.org] <B>On Behalf Of </B>Jos
Koot<BR><B>Sent:</B> jueves, 29 de septiembre de 2011 19:55<BR><B>To:</B> 'Neil
Van Dyke'<BR><B>Cc:</B> 'Matthew Flatt'; 'Racket-users'<BR><B>Subject:</B> Re:
[racket] case form implemented with a hash<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=667115317-29092011><FONT color=#0000ff
size=2 face=Arial>A vector with closures is (in my case) hardly faster than a
normal case form without closures.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=667115317-29092011><FONT color=#0000ff
size=2 face=Arial>See my other post on using a binary search without closures.
In my case a gain of 10% only.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=667115317-29092011><FONT color=#0000ff
size=2 face=Arial>Jos</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=en-us class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> Neil Van Dyke
[mailto:neil@neilvandyke.org] <BR><B>Sent:</B> jueves, 29 de septiembre de 2011
17:10<BR><B>To:</B> Jos Koot<BR><B>Cc:</B> 'Matthew Flatt';
'Racket-users'<BR><B>Subject:</B> Re: [racket] case form implemented with a
hash<BR></FONT><BR></DIV>
<DIV></DIV><BR>
<BLOCKQUOTE cite=mid:337B27C48DA04BF9B2B230C37DE03327@samsungPC type="cite">
<P><SPAN lang=es><FONT size=2 face="Courier New">At Thu, 29 Sep 2011 12:25:16
+0200, "Jos Koot" wrote:</FONT></SPAN> <BR><SPAN lang=es></SPAN><BR><SPAN
lang=es><FONT size=2 face="Courier New">> In my case I have a case form
which dispatches on a character, 86 different</FONT></SPAN> <BR><SPAN
lang=es><FONT size=2 face="Courier New">> ones. Therefore I can dispatch by
means of a vector. However, almost every</FONT></SPAN> <BR><SPAN lang=es><FONT
size=2 face="Courier New">> character has its own clause and therefore
dispatching on the index of the</FONT></SPAN> <BR><SPAN lang=es><FONT size=2
face="Courier New">> character would give no speed
up.</FONT></SPAN></P></BLOCKQUOTE><BR>Do I understand correctly that this
jump-table-like vector-of-closures is not fast enough?<BR><BR>If this were
assembler for a conventional architecture, and you were doing a DFA-like lexer,
I'd think that a jump table would be quite fast (but with some bloated constant
for code size).<BR><BR>I wonder whether there's an optimization the compiler/JIT
can make that would be a big help, perhaps with additional hints from the Racket
code? And if so, would that optimization likely be useful for anything
other than optimizing "case" of characters?<BR><BR>
<DIV class=moz-signature>-- <BR><A class=moz-txt-link-freetext
href="http://www.neilvandyke.org/">http://www.neilvandyke.org/</A>
</DIV></BODY></HTML>