justforfunc #22: using the Go execution tracer

  Рет қаралды 22,084

justforfunc: Programming in Go

justforfunc: Programming in Go

Күн бұрын

Пікірлер: 80
@joecarter4512
@joecarter4512 7 жыл бұрын
One of your best episodes so far. This was really interesting, I'm up for more episodes like this!
@Danielshenking
@Danielshenking 2 жыл бұрын
Every step of inference of optimizing is amazing. Particularly love this episode by far.
@azzalos
@azzalos 5 жыл бұрын
I watched this again and it was super helpful. I wish there were more of these. I also find it funny how you get excited about performance improvements as if you've just discovered them for the first time.
@sdero499
@sdero499 7 жыл бұрын
This was the best func yet. Seriously, breaking down code and just tracing through while optimizing is insanely helpful. More observability always!
@markmcdonnell
@markmcdonnell 7 жыл бұрын
I've been needing to understand profiling in go for a while. I've never really grok'ed it properly before but you've made it so super simple. Thank you ❤️
@Dolanor
@Dolanor 5 жыл бұрын
Wanted to exactly say that. That was an amazing episode!
@nikhilchoudhary6891
@nikhilchoudhary6891 3 жыл бұрын
Watching from India.The comparison is really cool and would love to watch more such videos. Thanks
@JeffRAllenCH
@JeffRAllenCH 7 жыл бұрын
You can also tell it's working better with createRow because time said that CPU was over 600% (theoretical max was 800%). Also, beginners needed a better description of why none of your (working) programs had data races. There are two cardinal sins when using goroutines: 1. communicating by sharing (unless you know why it's safe) and 2. not knowing when your goroutines exit (thanks Uncle Dave). You did a great job of showing that even in toy programs your goroutines have to exit correctly.
@joonasfi
@joonasfi 6 жыл бұрын
I love to learn about perf / tooling videos like these!
@riftitsolutions2372
@riftitsolutions2372 7 жыл бұрын
I actually enjoy the go tooling because from every video I have seen and tutorials I followed on benchmarking performance, after watching your video I finally get it. Thanks.
@chrisvaughn01
@chrisvaughn01 7 жыл бұрын
Great episode. I really appreciate videos like this showing the tools available and how to approach performance problems.
@pawesajnog2248
@pawesajnog2248 7 жыл бұрын
Wow, trace tool is impressive! Another great just for func episode! Thanks Francesc :)
@lawrencehoffman3517
@lawrencehoffman3517 7 жыл бұрын
Great rundown. Immediate subscription. Going to go back and watch some of your other videos. Please keep these up!
@hugoschmitt1772
@hugoschmitt1772 7 жыл бұрын
Love the use of music for comedic effect ;)
@merlin2600
@merlin2600 7 жыл бұрын
Very interesting. I will immediately apply it to one of my first apps that is extremely CPU intensive and I did use the "let's create millions of routines and let Go handle it" approach.
@JeffDupont38
@JeffDupont38 7 жыл бұрын
Awesome! Love seeing how to effectively use these tools
@robertoferrer535
@robertoferrer535 7 жыл бұрын
Cada video te superas, gracias Francesc :)
@chneau
@chneau 6 жыл бұрын
That is a super episode, I knew pprof but now I know trace ! Cheers
@radoslavtomov9121
@radoslavtomov9121 7 жыл бұрын
Great video. Keep them coming :). Tooling and code reviews are spot on.
@KasisnuSingh
@KasisnuSingh 6 жыл бұрын
Love the style of presentation.
@JammyJay86
@JammyJay86 7 жыл бұрын
Great video! I like both types of videos, and like how you alternate them.
@shadowfaxenator
@shadowfaxenator 7 жыл бұрын
Thanks! More videos like this please
@igustingurahokaprinarjaya7482
@igustingurahokaprinarjaya7482 2 жыл бұрын
AMAZING! love it! Thank you for your effort creating this awesome amazing knowledge video
@jhaals
@jhaals 7 жыл бұрын
Tooling and performance is great! Thanks
@kimnielsen7818
@kimnielsen7818 7 жыл бұрын
I really enjoyed this .. Thanks :) I wouldn't mind more about tooling or ways to optimize so please keep'em comming
@rajendragosavi2233
@rajendragosavi2233 3 жыл бұрын
That was crazy. Thanks for explaining such. a complex topic. I am late in the race, trying to learn as much I can. :)
@llgmusic
@llgmusic 7 жыл бұрын
Thanks, good demonstration on how to optimize code with go tools
@caeliferog
@caeliferog 7 жыл бұрын
Great video! It would be nice if you mentioned navigation keys you use to zoom on the trace.
@ezg5221
@ezg5221 4 жыл бұрын
Oh boy, I'll be coming back to this one
@quillaja
@quillaja 5 жыл бұрын
I'd like to know more about how to do optimizations in Go such as avoiding cache misses and aligning (slices/arrays of) data in memory. Also, and probably more importantly, how to reduce allocations and garbage collection.
@morwar_
@morwar_ 7 жыл бұрын
Amazing video, the tracer tool is really good and you explained it very well. Twenty days for GopherconBR, see you there Francesc!
@MAtloi
@MAtloi 7 жыл бұрын
This video gives me a good feeling that using the worker pools is most of the time the right pattern I use! The video was awesome! Keep these coming, because I feel like a lot of stdlib things aren't very well documented, explained or advertised. One question I have for long running programs: Can you create traces while running e.g. in a container, like it's possible with pprof via http? Thanks! :)
@RandomShowerThoughts
@RandomShowerThoughts 5 жыл бұрын
this video was incredible!
@ronanlanigan
@ronanlanigan 7 жыл бұрын
Excellent video, keep them coming :-)
@jepkofficial
@jepkofficial 7 жыл бұрын
I def would enjoy more videos using the go tooling for A/B testing code performance.
@MaisonArmani
@MaisonArmani 7 жыл бұрын
Thanks bro.... This is crazy helpful...
@shaikmuzakkir
@shaikmuzakkir 2 жыл бұрын
Very informative. Can you please let me know how I can zoom into the graphs on my mac?
@shaikmuzakkir
@shaikmuzakkir 2 жыл бұрын
I figured it out. Thanks!
@MichaelYinger_Beginner
@MichaelYinger_Beginner 7 жыл бұрын
Very informative. Thanks.
@hualetwang3105
@hualetwang3105 7 жыл бұрын
Nice video, very useful.
@baranda1985
@baranda1985 6 жыл бұрын
Amazing video, really enlightening!
@soumyaprakashdatta
@soumyaprakashdatta 7 жыл бұрын
This was really awesome ... loved the video :)
@MarEkkertsen
@MarEkkertsen 7 жыл бұрын
A really good one. Thank you sir!
@b4ux1t3-tech
@b4ux1t3-tech 7 жыл бұрын
So, you going through this helped me _finally_ grok goroutines and channels. Plus, I know about trace now (I didn't even know it existed).
@ilyushka21st
@ilyushka21st 7 жыл бұрын
First of all, I want to say: Thank you, for a good job. Want to ask, what the shortcut do you use to enlarge the trace in a browser?
@lovekeys1908
@lovekeys1908 6 жыл бұрын
Thanks! Great help! More vids like this, please :)
@ugur_dincer
@ugur_dincer 5 жыл бұрын
Me and the boys gonna watch this again, reserved.
@tjholowaychuk4646
@tjholowaychuk4646 7 жыл бұрын
Awesome as usual!
@arthurnn
@arthurnn 7 жыл бұрын
gracias .. great work!
@RealShabana
@RealShabana 6 жыл бұрын
This is amazing really
@konstantin8105L
@konstantin8105L 7 жыл бұрын
Thanks.
@nxxxxzn
@nxxxxzn 5 жыл бұрын
I guess the best would be to divide the image into 8 parts, for each go routine..? So that each go routine gets ~500k pixels
@valentindeleplace7860
@valentindeleplace7860 7 жыл бұрын
Great video What you call createRow, I would call createColumns. Disclaimer: I have ~50% chance of being wrong...
@Daniel-wt9bh
@Daniel-wt9bh 5 жыл бұрын
Thanks!
@vladimirbauer6604
@vladimirbauer6604 7 жыл бұрын
Thank you Francesc! Some of patterns you've showed, have well established names, so it would be nice if you'll refer to "official" name where appropriate. For example, last pattern you've used is called bounded parallelism, as far as I know. PS: nice caveat561 gotcha :)
@dineshdevaraj1844
@dineshdevaraj1844 3 жыл бұрын
Great Man
@andreaswestberg536
@andreaswestberg536 7 жыл бұрын
Can the videos be watched offline? Like watching in areas where Wi-Fi not accessible
@JustForFunc
@JustForFunc 7 жыл бұрын
+Andreas Westberg KZbin Red makes it easy, but I'm sure there's other ways
@simonarcher1510
@simonarcher1510 3 жыл бұрын
This is helpful, but I need to mention how challenging this is when you have a real program. It’s much harder “in the wild”. Having unit tests to ensure that your optimization did not break anything is recommended over manual inspection.
@theyruinedyoutubeagain
@theyruinedyoutubeagain 7 жыл бұрын
"Top see you em" for cumulative. I loved how awkward that was! xD
@abhijitiitr
@abhijitiitr 7 жыл бұрын
This somehow shows that blocking send/receive on a channel(2048 times) has more overhead than the scheduler scheduling 2048 goroutines on 8 cores. Since there are only 8 goroutines in the first case and the process is CPU heavy, so I don't expect any of the 8 goroutines getting scheduled on/off from the CPU. Please feel welcome to critique this hypothesis.
@SeshachalamMalisetti
@SeshachalamMalisetti 7 жыл бұрын
how should one decide on the number of go routines to spawn(here 8 routines) ? programs run on different machines.
@JustForFunc
@JustForFunc 7 жыл бұрын
+Seshachalam Malisetti you could use the runtime package to figure out how many CPUs are available
@SeshachalamMalisetti
@SeshachalamMalisetti 7 жыл бұрын
yeah, runtime.NumCPU() but to find the optimal number of worker routines how to proceed ? somewhere in irc channel i heard someone saying dont use numcpu
@patenlikoyun
@patenlikoyun 7 жыл бұрын
What's that text editor?
@MarcoCarmonaT
@MarcoCarmonaT 7 жыл бұрын
Visual Studio Code.
@patenlikoyun
@patenlikoyun 7 жыл бұрын
Thanks
@alexandersvensson1253
@alexandersvensson1253 7 жыл бұрын
Why do you build the program instead of using "go run" ?
@oliverbutterfield9844
@oliverbutterfield9844 7 жыл бұрын
Alexander Svensson because he was trying to time the performance of the thing. Some of the time spent in go run is compiling stuff, so it adds overhead to each test.
@JimmyStewpot
@JimmyStewpot 7 жыл бұрын
Alexander Svensson because the time command would also so the compile time for the binary. He mentioned briefly at the start.
@alexandersvensson1253
@alexandersvensson1253 7 жыл бұрын
Ah, makes sense, thanks for the answers :)
@ulissemini5492
@ulissemini5492 6 жыл бұрын
i ' m a l r e a d y t r a c e r
@theyruinedyoutubeagain
@theyruinedyoutubeagain 7 жыл бұрын
50th! Now, to watch the video.
@jjanx4820
@jjanx4820 7 жыл бұрын
That command flag lol
@zelimirfedoran9720
@zelimirfedoran9720 3 жыл бұрын
So... "don't use channels". Got it ;p
@LuisFigueiredoz
@LuisFigueiredoz 7 жыл бұрын
go channels have some overhead and can get a bit slower than a simple mutex, github.com/golang/go/wiki/MutexOrChannel A discussion on the topic: news.ycombinator.com/item?id=11210578 (I disagree that channels are bad)
@theyruinedyoutubeagain
@theyruinedyoutubeagain 7 жыл бұрын
"My mac has 8 cores". It's threads, not cores. Literally unwatchable.
@theyruinedyoutubeagain
@theyruinedyoutubeagain 7 жыл бұрын
Just kidding of course. Love your videos ❤️
@theyruinedyoutubeagain
@theyruinedyoutubeagain 7 жыл бұрын
Also, is the correct nomenclature hyperthreads? Otherwise it's confusing with OS threads.
justforfunc #21: reviewing ursho II - using PostgreSQL
19:24
justforfunc: Programming in Go
Рет қаралды 10 М.
justforfunc #37: sync.Pool from the pool
27:11
justforfunc: Programming in Go
Рет қаралды 17 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 18 МЛН
justforfunc #23: plotting latency distributions with gonum
38:28
justforfunc: Programming in Go
Рет қаралды 10 М.
Twelve Go Best Practices - Francesc Campoy
49:27
Esri R&D Center
Рет қаралды 70 М.
justforfunc #35: Implementing the tree command from scratch
30:54
justforfunc: Programming in Go
Рет қаралды 12 М.
justforfunc #24: what's the most common identifier in the Go stdlib?
17:02
justforfunc: Programming in Go
Рет қаралды 8 М.
Golang UK Conference 2016 - Dave Cheney - SOLID Go Design
27:30
GopherCon UK
Рет қаралды 110 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Cracking Enigma in 2021 - Computerphile
21:20
Computerphile
Рет қаралды 2,5 МЛН
Coding Adventure: Atmosphere
22:00
Sebastian Lague
Рет қаралды 1,1 МЛН