[08x02] Julia Performance Tips and Tools | How to use @time, @profile, @profview, @profview_allocs

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024

Комментарии • 30

  • @chrissaunders9365
    @chrissaunders9365 Год назад +5

    Incredibly clear and effective tutorials - thank you (looking forward to doing the complete series sets). Brilliant style, thanks again!

    • @doggodotjl
      @doggodotjl  Год назад

      You're welcome! Have fun exploring the tutorials!

  • @user-rw6nn7uc8b
    @user-rw6nn7uc8b Год назад +2

    Best Julia lang video as always. It helps me a lot. Thank you, Doggo!

  • @mockingbirdsphysicschannel9774
    @mockingbirdsphysicschannel9774 Год назад +2

    This video is so great. I am a newbie at Julia and your content is helping me a lot.

    • @doggodotjl
      @doggodotjl  Год назад

      Glad to be of service! Welcome to the World of Julia!

  • @Se-pk8lg
    @Se-pk8lg Год назад +5

    I am loving your videos. Do you have a video about create environments for julia peojects?
    By the way I am happy you are using VSCode. It is lore easy and more intuitive. Keep it up!

    • @alimeresvargas8002
      @alimeresvargas8002 Год назад +1

      Hi, it's correct, in the previous sessions, he explains how to create them.

    • @doggodotjl
      @doggodotjl  Год назад +2

      I cover the basics in a few different videos, but the best video for this is actually a JuliaCon 2021 workshop by Sebastian Pfiztner where he presents Julia Package Development in VS Code ruclips.net/video/F1R3ETaRQXY/видео.html Good luck!

  • @augustocleal
    @augustocleal Год назад +5

    I thought you would change the vector Any to teach how Julia infer types and show how the use of Any deteriorate performance. That it was a good moment for this

    • @doggodotjl
      @doggodotjl  Год назад +1

      Definitely a missed opportunity!

  • @fugoogle_was_already_taken
    @fugoogle_was_already_taken 9 месяцев назад +1

    The compilation time was "higher" in percentitage points, but the overall speed was different, so it does not make sense to compare % without computing the actuall time spent compiling

  • @ChengyiWang-x5t
    @ChengyiWang-x5t 26 дней назад

    greater than julia official tutorial ❤

  • @d.u.c.a.n.h.l.e
    @d.u.c.a.n.h.l.e Год назад +1

    thank you very much!

  • @LiorAssouline
    @LiorAssouline Год назад +1

    Great one! waiting for a Debugging julia code video :)

    • @doggodotjl
      @doggodotjl  Год назад +1

      Hi, thank you for the suggestion. However, I will probably not be covering a Debugger in this series. There are some other resources on debugging in Julia available online. This JuliaCon 2021 workshop on Package Development covers some of the available tools: ruclips.net/video/wXRMwJdEjX4/видео.html Good luck!

  • @user-mv6qt9ot8r
    @user-mv6qt9ot8r 9 месяцев назад +1

    Perfect...

  • @animator89
    @animator89 Год назад +1

    Thanks

  • @ugowar
    @ugowar Год назад +2

    I noticed an even bigger time reduction when I used broadcast on the assignment operator as well, i.e.
    z .= a.*x .+ y instead of
    z = a.*x .+ y
    Also, it boggles my mind why the for loop method needs to have millions of allocations, even when I preallocate all the arrays (no push!()) and don't even use a temp variable - not that the last bit should make any difference to a modern compiler.

    • @doggodotjl
      @doggodotjl  Год назад

      Good catch. As you figured out, you need to pre-allocate z before you can use z .= a .* .+ y. When you pre-allocate, you can use z = zeros(Float32, n) in order to pre-allocate it with 32-bit numbers. Regarding the loop method, I failed to mention that you should never use z = [], which is an empty Array of Type Any, so Julia needs to allocate all of that memory just in case there are 32-bit numbers, 64-bit number, Strings, etc... If you pre-allocate z using z = zeros(Float32, n), there shouldn't be that many allocations. The more specific you are regarding the data types, the less memory Julia will allocate. Cheers!

    • @etiennekant
      @etiennekant Год назад

      For optimal speed you would actually want to use z=Vector{Float32}(undef, n). This is faster then zeros(Float32, n) since it does not care what the numbers in z are, we are going to overwrite them any way.
      Most of the time the array will be mostly zeros, but there can be random garbage in there, again since we are going to overwrite the whole vector it does not matter

    • @doggodotjl
      @doggodotjl  Год назад

      @@etiennekant Ah, yes, that's much better. Thanks for sharing!

  • @arturleperoke3205
    @arturleperoke3205 Год назад

    Hi Doggo,
    are your turorials/series devided by interest/topic or are they somewhat consecutive?
    Meaning do I need your other tutorials/series for before diving into #08 ?

    • @doggodotjl
      @doggodotjl  Год назад +2

      It depends on your background. In general, I would recommend watching Series 1 (Intro to Julia), Series 2 (Intro to Data Analysis/Visualization), Series 5 (Intro to Machine Learning) and Series 7 (Intro to Differential Equations) before watching Series 8. If you already have those skills, then you can skip the other series and jump straight into Series 8. Good luck!

  • @MrDoraHo
    @MrDoraHo Год назад +1

    Great video!
    btw, so far I see you are using visual code for the IDE, but for scientific computing, jupyter-notebook will be more intutive and efficient to present the information
    May be you should try it also!

    • @doggodotjl
      @doggodotjl  Год назад +2

      Hi, thanks for watching and thank you for the suggestion! I will probably not be using Jupyter notebooks in this series, but I may be using Pluto notebooks. In my opinion Pluto is a better notebook environment for Julia. I have a 13-part series where I introduce Pluto notebook and use them for Differential Equations (Series 07) if you are interested: ruclips.net/video/ex6dlDJgNNE/видео.html

  • @alimeresvargas8002
    @alimeresvargas8002 Год назад +1

    Hi Doggo I have a question, how do you make those comment blocks in your code? Regards

    • @doggodotjl
      @doggodotjl  Год назад +1

      I'm cheating, lol! I type them in manually. In the video, I'm just copying and pasting the text from a different file.