Julia speed

This might be useful, depending on your field: 2021_FortranCon/benchmark_vs_fortran/README.md at main · m3g/2021_FortranCon · GitHub

FastPow.jl will do this transformation for you. However, accumulating terms iteratively, unrolling alternating terms, and similar tricks are usually even better for summing series.

4 Likes

If you have not found it yet, this site is a good beginner’s guide to the best ways to write, execute, and share Julia programs:
https://modernjuliaworkflows.github.io

3 Likes

That’s great ! Thanks a lot for this link !

Thank you very much for this link ! It will help me a lot ! :slight_smile:

I just way to say that I see threads of this kind all the time. Especially when it comes to writing fast code, or where the question is asked nicely with all details required to help people answer. There are a lot of really helpful and knowledgable people on this forum, so do not hesitate to ask similar questions! Or do as I do, and creep around other people’s questions to learn more about Julia :sweat_smile:

P.s. To format you code nicely, enclose it in triple backticks:
```
Your code here
1+1=2
```
Which displays as

Your code here
1+1=2

It is one of those things that just make people more likely to help you, because it feels like some effort has been put into writing the question in a way that is easy to read and understand. Some people really put minimal effort into asking questions and doing followup, and they are no fun to help.

Also, it is syntax highlighted as julia code by default on this forum :grin:

2 Likes

This introductory book written by a physicist may help you and your students in becoming better acquainted with Julia.

Thanks for this advice ! I’ve just bought this book and I’m waiting for it !

“Julia compiles the functions to specialized machine code the first time they are executed. The compilation time here is negligible. If one writes the code outside functions, however, the code is not specialized and runs interpreted, which is slow.”

I just learned something. Thank you for this.