What exactly gives performance problems, when calling from HiPE to beam and back?<br>Marshalling arguments?<br><br>But NIF doesn't require marshalling data. Maybe it is possible to achieve something like in LLVM, when function is transparently compiled from bytecode to some native.<br>
<br>Maybe there were some discussions on this mailing list about it?<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 9, 2012 at 11:06 PM, Fred Hebert <span dir="ltr"><<a href="mailto:mononcqc@ferd.ca" target="_blank">mononcqc@ferd.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    We've used HiPE in parts of our system that required tight fast
    loops. Whenever we need something to go fast due to some algorithmic
    complexity, <i>and</i> that we can manage to isolate it as a single
    unit that doesn't need to call to non-HiPE code, we will try to
    convert it.<br>
    <br>
    Basically, I've been told that HiPE and Beam have some overhead when
    it comes to switching from one to the other. When we have a bit of
    code that is a hotspot, I'll try to inline whatever calls are made
    to other modules (mostly lists), compile only that module with HiPE,
    and let it do its thing. Sometimes benchmarks go in HiPE's favour,
    sometimes not.<br>
    <br>
    In a particular instance of our stack, it gave us nearly 2x speedup
    on loop & search operations that frequently happen more than
    50,000 times per second. Definitely worth it, and it's been running
    in production for months, just for that single module.<div><div class="h5"><br>
    <br>
    <div>On 12-11-09 8:45 AM, Valentin Micic
      wrote:<br>
    </div>
    <blockquote type="cite">Interestingly enough, this was a kind of conclusion
      we've arrived at as well -- the good performance of Beam, combined
      with "perceived instability", acted as a serious deterrent for me.
      <div>
        <div>But Max, wouldn't you like to know if there are any brave
          souls out there that were prepared to go beyond perceptions
          and successfully tried it in "real-life" situation?</div>
        <div><br>
        </div>
        <div>V/</div>
        <div>
          <div><br>
          </div>
          <div><br>
            <div>
              <div>On 09 Nov 2012, at 3:34 PM, Max Bourinov wrote:</div>
              <br>
              <blockquote type="cite">Unrelated, but: we were
                considering to give a try to HiPE but so far there is no
                need to do it for us because Beam outperforms everything
                else in our problem domain.
                <div><br>
                </div>
                <div><br clear="all">
                  <div>Best regards,</div>
                  <div>Max</div>
                  <br>
                  <br>
                  <br>
                  <br>
                  <div class="gmail_quote">On Fri, Nov 9, 2012 at 5:16
                    PM, Valentin Micic <span dir="ltr"><<a href="mailto:valentin@pixie.co.za" target="_blank">valentin@pixie.co.za</a>></span>
                    wrote:<br>
                    <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                      Unrelated, but would be interesting to find out --
                      are there any commercial-grade (let alone
                      carrier-grade) systems that take advantage of
                      HiPE?<br>
                      <span><font color="#888888"><br>
                          <br>
                          V/<br>
                        </font></span>
                      <div>
                        <div><br>
                          On 09 Nov 2012, at 2:11 PM, Schneider wrote:<br>
                          <br>
                          > you're right. HIPE generates compiled
                          code.<br>
                          > my mistake.<br>
                          > take a look here for more info's about
                          HIPE:<br>
                          > <a href="http://user.it.uu.se/%7Ekostis/Papers/erlang03.pdf" target="_blank">http://user.it.uu.se/~kostis/Papers/erlang03.pdf</a><br>
                          ><br>
                          > greatz Johannes<br>
                          ><br>
                          ><br>
                          > On Fr 09 Nov 2012 13:07:49 CET, Matti
                          Oinas wrote:<br>
                          >> Correct me if I'm wrong but doesn't
                          HIPE compile to native code?<br>
                          >><br>
                          >> --<br>
                          >> Matti<br>
                          >><br>
                          >> On Fri, Nov 9, 2012 at 1:57 PM,
                          Schneider <<a href="mailto:js@globe.de" target="_blank">js@globe.de</a>>
                          wrote:<br>
                          >>> Erlang is a language, which
                          produced byte-code which get' interpreted by
                          the<br>
                          >>> Erlang engine. C++ instead
                          generates mashing-code which has on the one
                          hand<br>
                          >>> a much better performance, on the
                          other hand,<br>
                          >>> some disadvantages like
                          incompatibility between different OSs.<br>
                          >>><br>
                          >>> greatz Johannes<br>
                          >>><br>
                          >>><br>
                          >>> On Fr 09 Nov 2012 09:42:21 CET,
                          hume npx wrote:<br>
                          >>>><br>
                          >>>> Hi, all:<br>
                          >>>>   I'am new to erlang, after
                          investigate some benchmark such as at<br>
                          >>>> <a href="http://shootout.alioth.debian.org/u64q/which-programs-are-fastest.php" target="_blank">http://shootout.alioth.debian.org/u64q/which-programs-are-fastest.php</a>,<br>
                          >>>> I found that erlang compiler
                          is not so good at speed? the benchmark<br>
                          >>>> shows that erlang Hipe is 13x
                          slowdown compared to C++, as compared to<br>
                          >>>> Haskell GHC (3.3x slowdown),
                          go 2.98x slowdown or even javascript v8<br>
                          >>>> is about 1x faster than
                          erlang, I investigated the erLLVM project<br>
                          >>>> which reported similar
                          results to Hipe, you know performance is so<br>
                          >>>> important nowadays, what
                          caused the hard to improve performace of<br>
                          >>>> erlang or just there are not
                          people working on it? Erlang is<br>
                          >>>> attractive to me after
                          several days studying, but with great<br>
                          >>>> performance will be more
                          attractive and competitive to some languages<br>
                          >>>> such as go etc.<br>
                          >>>><br>
                          >>>><br>
                          >>>>
                          _______________________________________________<br>
                          >>>> erlang-questions mailing list<br>
                          >>>> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
                          >>>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
                          >>><br>
                          >>><br>
                          >>><br>
                          >>>
                          _______________________________________________<br>
                          >>> erlang-questions mailing list<br>
                          >>> <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
                          >>> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
                          ><br>
                          ><br>
                          >
                          _______________________________________________<br>
                          > erlang-questions mailing list<br>
                          > <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
                          > <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
                          <br>
_______________________________________________<br>
                          erlang-questions mailing list<br>
                          <a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
                          <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
                        </div>
                      </div>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </blockquote>
            </div>
            <br>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
erlang-questions mailing list
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
    </blockquote>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>