<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoPlainText>There doesn’t seem to be any type of binary data type matching in a match specification besides ‘==’ or ‘/=’. To compare apples to apples and to exclude OS/hardware variances the following test shows the differences in using a 4 segment binary as a key (128bits total) and a 4-tuple of integers as a key. The segments of the binary and the tuple values for the lookups are randomly generated so as to eliminate any type of issue there. The methodologies in the 2 algorithms are exactly the same save the form of the key. Based on this data the speed of binary based lookups are somewhat superior than tuple based lookups. The problem is that we have a need to do certain types of ets matching on the binary keys (3 segments are _ whereas one segment is an int()). The question is this:<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Why are there no other ets match conditions than ‘==’ and ‘/=’?<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Is it just a development time/complexity issue or is there a more fundamental reason such as reducing the use of match specifications in favor of another approach. Or is it simply convention that this type of problem is best solved using the tuple approach? Our issue is that 99.999% of the time we need the speed of the binary ‘==’ match and the rest of the time we need an incredibly simple match on a portion of the binary. And the memory cost of storing an alternate structure for that small use case is not acceptable. It would be great if even ‘band’ could operate on a binary type in a match specification.<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText>Thoughts?<o:p></o:p></p><p class=MsoPlainText><o:p> </o:p></p><p class=MsoPlainText><span style='font-family:"Courier New"'>% Col1 == Number of elements in table<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>% Col2 == Memory size of table<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>% Col3 == Average ets:member/sec for 10M lookups<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>1> test:do_ets_test(). % Using 4 segment 128bit Binary for Key lookup<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>4, 362, 7369196<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>19, 557, 6476683<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>79, 1337, 6476683<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>319, 4457, 6345177<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>1279, 16937, 5882352<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'><o:p> </o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>3> test:do_ets_test(). % Using 4 element tuple of integers for Key lookup<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>4, 358, 6345177<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>19, 538, 5773672<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>79, 1258, 5777007<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>319, 4138, 5724098<o:p></o:p></span></p><p class=MsoPlainText><span style='font-family:"Courier New"'>1279, 15658, 5479452<o:p></o:p></span></p><p class=MsoPlainText><o:p> </o:p></p></div></body></html>