<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <p>I use, with binaries like <<1:1000000>>,</p>
    <pre style="background-color:#ffffff;color:#000000;font-family:'Menlo';font-size:18.0pt;">one(<span style="color:#660e7a;">F</span>,<<<span style="color:#660e7a;">Size</span>:<span style="color:#0000ff;">64</span>/unsigned, <span style="color:#660e7a;">Bitmap</span>:<span style="color:#660e7a;">Size</span>/bitstring, <span style="color:#660e7a;">_</span>/bitstring>><span style="color:#660e7a;"></span>) ->
  one(<span style="color:#660e7a;">F</span>,<span style="color:#660e7a;">Bitmap</span>,<span style="color:#0000ff;">0</span>,[])<span style="color:#000080;font-weight:bold;">.
</span>one(<span style="color:#660e7a;">F</span>, <<<span style="color:#0000ff;">0</span>:<span style="color:#0000ff;">1</span>, <span style="color:#660e7a;">R</span>/bitstring>>, <span style="color:#660e7a;">N</span>, <span style="color:#660e7a;">Acc</span>) ->
  one(<span style="color:#660e7a;">F</span>, <span style="color:#660e7a;">R</span>, <span style="color:#660e7a;">N </span>+ <span style="color:#0000ff;">1</span>, <span style="color:#660e7a;">Acc</span>);
one(<span style="color:#660e7a;">F</span>, <<<span style="color:#0000ff;">1</span>:<span style="color:#0000ff;">1</span>, <span style="color:#660e7a;">R</span>/bitstring>>, <span style="color:#660e7a;">N</span>, <span style="color:#660e7a;">Acc</span>) ->
  one(<span style="color:#660e7a;">F</span>, <span style="color:#660e7a;">R</span>, <span style="color:#660e7a;">N </span>+ <span style="color:#0000ff;">1</span>, [<span style="color:#660e7a;">F</span>(<span style="color:#660e7a;">N</span>) | <span style="color:#660e7a;">Acc</span>]);
one(<span style="color:#660e7a;">_</span>, <<>>, <span style="color:#660e7a;">_</span>, <span style="color:#660e7a;">Acc</span>) -> <span style="color:#660e7a;">Acc</span><span style="color:#000080;font-weight:bold;">.
</span><span style="color:#000080;font-weight:bold;">
</span>union(<<<span style="color:#660e7a;">Size</span>:<span style="color:#0000ff;">64</span>/unsigned, <span style="color:#660e7a;">L</span>:<span style="color:#660e7a;">Size</span>/unsigned, <span style="color:#660e7a;">P</span>/bitstring>>,
    <<<span style="color:#660e7a;">Size</span>:<span style="color:#0000ff;">64</span>/unsigned, <span style="color:#660e7a;">R</span>:<span style="color:#660e7a;">Size</span>/unsigned, <span style="color:#660e7a;">_</span>/bitstring>>) ->
  <<<span style="color:#660e7a;">Size</span>:<span style="color:#0000ff;">64</span>/unsigned, (<span style="color:#660e7a;">L </span><span style="color:#000080;font-weight:bold;">bor </span><span style="color:#660e7a;">R</span>):<span style="color:#660e7a;">Size</span>/unsigned, <span style="color:#660e7a;">P</span>/bitstring>><span style="color:#000080;font-weight:bold;">.
</span>
</pre>
    <p>and call this functions 1,000,000 times, this takes for 1,000
      calls about 20 minutes, <br>
    </p>
    <p>if i compile with native -compile([native,{hipe, o2}])<span
        style="color:#000080;font-weight:bold;"> </span>it takes 3
      seconds for 1,000 calls, so it is about 400x faster !!</p>
    <p>OS: OSX<br>
    </p>
    <p>What is the secret?<span style="color:#000080;font-weight:bold;"></span></p>
    <pre class="moz-signature" cols="72">-- 
Grüße
Oliver Bollmann</pre>
  </body>
</html>