It may seem hard to believe that a dynamic language can be fast, but Julia is really high performance in a way I think people have a hard time wrappin

Is Julia Really Fast?

submited by
Style Pass
2021-06-20 15:00:02

It may seem hard to believe that a dynamic language can be fast, but Julia is really high performance in a way I think people have a hard time wrapping their heads around.

But that is about 1.5 hours, so here is the quick rundown. I use a nonsense function in Julia just to demonstrate how highly dynamic code can be optimize in Julia.

This tends to be hard to optimize. People using Python should be accustomed to this. If you pass some custom Python code kernel into a module with C++ code, it will be hard to optimize. Likewise if you pass a function pointer to another C function, the compiler cannot optimize that as it cannot know in advance what function will get passed as argument.

With this in mind. Try to imagine in the ballpark of how much machine code would get generated to run the following expression at the Julia command line:

Below you can see the machine code this turns into. Now you may not know x86 assembly, so let me give a little walk through. The addq instructions are simple additions, and leaq, is additions and shift (multiply with numbers which are multiples of 2), and retq returns the result.

Leave a Comment