Daniel Lemire's blog

, 3 min read

Performance overhead when calling assembly from Go

4 thoughts on “Performance overhead when calling assembly from Go”

  1. me says:

    What “more modern” languages have you evaluated with respect to their overhead of calling C or assembly?
    So Go comes at some overhead, what about Rust, Julia, Swift? These should come at zero overhead, as they use LLVM?
    Vala? As it apparently is compiled ‘into’ C code, there shouldn’t be much overhead.
    Dart? Apparently you can use SIMD in Dart somehow. Probably not when compiling into JavaScript though.
    I have always been wondering what language to use for my next project; as I have always been hitting the limits of Java. Go and Rust have been two candidates to learn.

    1. So Go comes at some overhead, what about Rust, Julia, Swift? These should come at zero overhead, as they use LLVM?

      Swift can call C without overhead…

      http://lemire.me/blog/2016/09/29/can-swift-code-call-c-code-without-overhead/

      I don’t know about Julia and Rust.

      Go and Rust have been two candidates to learn.

      Go can be learned quickly. So there is that.

      Swift is more challenging but a lot of fun, and certainly more interesting than Java.

      I don’t know a lot about Rust. Looked ok at a glance.

  2. fuz says:

    Note that while tzcnt is “new,” it is merely a variant of the good old bsf instruction with some extra behaviour. bsf was introduced with the 80386.

    1. That’s true. The behavior is different if the input word is zero…