<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><br style="font-family: Helvetica; font-size: 12px;"><span style="font-family: Helvetica; font-size: 12px;">Hi,</span><div><br></div><div><span style="font-family: Helvetica; font-size: 12px;">We have a bit of code that was implemented in a NIF: Erlang->NIF->Socket->Destination and the reverse went Source->Socket->NIF->Erlang.</span><br style="font-family: Helvetica; font-size: 12px;"><br style="font-family: Helvetica; font-size: 12px;"><span style="font-family: Helvetica; font-size: 12px;">The NIF code was getting a bit flakey so we made the call to implement it as a CNODE instead to avoid the NIF taking down the VM if it crashed. Now I understand that a CNODE call will be slower due to the extra hop, but we are seeing a massive (14x) decrease for this particular call. The code is based on the example on the Erlang website (ei_send on the C side and {any,?SERVER} ! Message on the Erlang side).</span><br style="font-family: Helvetica; font-size: 12px;"><br style="font-family: Helvetica; font-size: 12px;"><span style="font-family: Helvetica; font-size: 12px;">Before we do a deep dive into any other changes I was wondering if you were aware of any quirks in how CNODE is implemented that could cause this? I’m specifically thinking if Erlang uses any name server to identify the physical port.</span><br style="font-family: Helvetica; font-size: 12px;"><br style="font-family: Helvetica; font-size: 12px;"><font face="Helvetica"><span style="font-size: 12px;">Thanks</span></font></div><div><br style="font-family: Helvetica; font-size: 12px;"><span style="font-family: Helvetica; font-size: 12px;">Matt</span></div> </div></body>
</html>