No video

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

  Рет қаралды 5,172

doggo dot jl

doggo dot jl

Күн бұрын

Пікірлер: 30
@chrissaunders9365
@chrissaunders9365 Жыл бұрын
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!
@ChengyiWang-x5t
@ChengyiWang-x5t 9 күн бұрын
greater than julia official tutorial ❤
@user-rw6nn7uc8b
@user-rw6nn7uc8b Жыл бұрын
Best Julia lang video as always. It helps me a lot. Thank you, Doggo!
@doggodotjl
@doggodotjl Жыл бұрын
You're welcome!
@fugoogle_was_already_taken
@fugoogle_was_already_taken 8 ай бұрын
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
@mockingbirdsphysicschannel9774
@mockingbirdsphysicschannel9774 Жыл бұрын
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!
@user-mv6qt9ot8r
@user-mv6qt9ot8r 8 ай бұрын
Perfect...
@augustocleal
@augustocleal Жыл бұрын
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 Жыл бұрын
Definitely a missed opportunity!
@d.u.c.a.n.h.l.e
@d.u.c.a.n.h.l.e Жыл бұрын
thank you very much!
@doggodotjl
@doggodotjl Жыл бұрын
You're welcome!
@Se-pk8lg
@Se-pk8lg Жыл бұрын
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 Жыл бұрын
Hi, it's correct, in the previous sessions, he explains how to create them.
@doggodotjl
@doggodotjl Жыл бұрын
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 kzfaq.info/get/bejne/fJeCZqiFxri1iI0.html Good luck!
@animator89
@animator89 Жыл бұрын
Thanks
@doggodotjl
@doggodotjl Жыл бұрын
Thank you!
@LiorAssouline
@LiorAssouline Жыл бұрын
Great one! waiting for a Debugging julia code video :)
@doggodotjl
@doggodotjl Жыл бұрын
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: kzfaq.info/get/bejne/rb6CgNp7yavOiGg.html Good luck!
@ugowar
@ugowar Жыл бұрын
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!
@MrDoraHo
@MrDoraHo Жыл бұрын
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 Жыл бұрын
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: kzfaq.info/get/bejne/m95ml891r82yfnk.html
@alimeresvargas8002
@alimeresvargas8002 Жыл бұрын
Hi Doggo I have a question, how do you make those comment blocks in your code? Regards
@doggodotjl
@doggodotjl Жыл бұрын
I'm cheating, lol! I type them in manually. In the video, I'm just copying and pasting the text from a different file.
@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 Жыл бұрын
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!
هذه الحلوى قد تقتلني 😱🍬
00:22
Cool Tool SHORTS Arabic
Рет қаралды 36 МЛН
Zombie Boy Saved My Life 💚
00:29
Alan Chikin Chow
Рет қаралды 25 МЛН
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Паша Осадчий
Рет қаралды 3,3 МЛН
Reproducible Publications with Julia and Quarto | J.J. Allaire | JuliaCon 2022
24:31
The Julia Programming Language
Рет қаралды 10 М.
Julia: Workflow Tips, and What is New in v1.9 |  2nd DigiWell Julia Seminar 2023
38:32
The Julia Programming Language
Рет қаралды 11 М.
LinearSolve.jl: Because A\b is Not Good Enough | Chris Rackauckas | JuliaCon 2022
13:47
The Julia Programming Language
Рет қаралды 10 М.
The State of Julia (In 2022) with Jeff Bezanson | JuliaCon 2022
29:33
The Julia Programming Language
Рет қаралды 19 М.