Deep .NET: Let's Build Our Own ArrayPool with Stephen Toub and Scott Hanselman

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 85

  • @CuriouslyContent
    @CuriouslyContent 2 หลายเดือนก่อน +30

    What I love about this series is that you have an expert who could, if asked to do so, completely overwhelm most regular developers with technical detail and advanced topics, but you also have a seasoned non-expert (in this area anyway) sitting in to ask questions and explore the knowledge space in a way that is comfortable for most mere mortals.

  • @mranthonymills
    @mranthonymills 2 หลายเดือนก่อน +29

    I'm really loving these "let's make a simple version of X so you understand it" videos!

  • @JasonBock
    @JasonBock 2 หลายเดือนก่อน +8

    I love this series. I really enjoy hearing Toub talk about these deep concepts.
    One request: get Toub a better mic :). Occasionally his voice got really quiet and it was hard to hear what he was saying.

  • @justgame5508
    @justgame5508 2 หลายเดือนก่อน +18

    Locking content next could be really interesting. ConcurrentDictionary, lock, Semaphore, SemaphoreSlim etc. I think most developers (me included) use and take these for granted without really knowing what they’re doing behind the scenes

  •  2 หลายเดือนก่อน +7

    Great episode. Suggestion for topics could be some math stuff like using optimized vectors SIMD etc. I think Tanner Gooding focuses on that area? Or various synchronization mechanisms in .NET (lock/Semaphore/SemaphoreSlim/new System.Threading.Lock.

  • @flygonfiasco9751
    @flygonfiasco9751 2 หลายเดือนก่อน +6

    Would love to see a similar video going in depth about the GC. Love this duo!

  • @yohannes2kifle
    @yohannes2kifle 2 หลายเดือนก่อน +9

    This is fast becoming my favorite series of your channel, and I really loved this episode

  • @egr0eg
    @egr0eg 2 หลายเดือนก่อน +7

    Great series, clear explanations. Maybe a future episode on how System.Threading.Channels are implemented(comparison with other producer consumer collections) or some concurrent collections internal implementations.

  • @Rob_III
    @Rob_III 2 หลายเดือนก่อน +10

    Over an hour of two legends! I'm a simple man, I click, I watch!

    • @georgepagotelis
      @georgepagotelis 2 หลายเดือนก่อน

      found the comment to like - cheers hahaha

  • @nokkeli
    @nokkeli 2 หลายเดือนก่อน +4

    That doggo looks sooo relaxed sleeping on the couch

  • @barionlp
    @barionlp 2 หลายเดือนก่อน +5

    can you make a deep dive on how to correctly measure performance? it seems trivial at first but I feel like there are so many things people do wrong when measuring

  • @chrisanders7257
    @chrisanders7257 2 หลายเดือนก่อน +2

    This is so great. Everytime I watch Stephen I'll learn something new

  • @GuildOfCalamity
    @GuildOfCalamity 2 หลายเดือนก่อน +2

    Love these roll-your-own videos, keep em coming plz!
    Small request: Can you use a dark theme? My eyeballs are burning after that.

  • @ahupond
    @ahupond 2 หลายเดือนก่อน +1

    So cool to get insights on how the framework actually works, and how it is expected to be used. The internet was definitely lacking content of that level of expertise, and I hope deep dotnet will continue for a long time. So excited to hear there'll be more guests, although I could be listening to Stephen for hours. He did set the standard at quite the level!

  • @talwald1680
    @talwald1680 2 หลายเดือนก่อน +1

    Great, as always! Please schedule these so we know they are coming!
    Also, I would love a deep dive on Kestral internals and all the great work put into that over the last few years.

  • @juanbautista6766
    @juanbautista6766 2 หลายเดือนก่อน +2

    Just started and already know this gonna be a banger of a video

  • @ollhax
    @ollhax 2 หลายเดือนก่อน +1

    Love this series! It's very interesting (and useful!) to get a glimpse of the inner workings and tradeoffs you talk about. As a game developer I tend to use _a lot_ of pooling, accepting the increased memory use and the sometimes reduced linear performance over having the GC kick in and cause frame drops that are very noticeable for the player. I hope this is a use case that is considered as well :)

  • @frotes
    @frotes 2 หลายเดือนก่อน +3

    I see Stephen and Scott, I like

  • @MatteoGariglio
    @MatteoGariglio 2 หลายเดือนก่อน +1

    Thanks for bringing up this topic! It's very interesting and instructive. I really like the 'Deep Dot Net' video series-there's always so much more to learn and ideas to draw inspiration from. Thanks for organizing it, and special thanks to Stephen for sharing his valuable knowledge!

  • @henrikstornblom
    @henrikstornblom 2 หลายเดือนก่อน +2

    These videos are so great and interesting. Thanks.

  • @JustinLampe
    @JustinLampe 2 หลายเดือนก่อน +3

    And the best series continues 🎉

  • @VitalyPavluk
    @VitalyPavluk 2 หลายเดือนก่อน

    Wow!! Such an amazing Deep .NET episode... See how the complex stuff is created from simple bricks by Stephen is kind of magic

  • @victorchisomnwisu9776
    @victorchisomnwisu9776 2 หลายเดือนก่อน +1

    didn't know you could do an assignment in a ternary operator. Thanks again for the video. Awesome!

    • @vyrp
      @vyrp 2 หลายเดือนก่อน +1

      Assignment is an expression, so you can put it almost anywhere.

  • @hafthors
    @hafthors 2 หลายเดือนก่อน +2

    Awesome content y'all. How about some content on how to diagnose CPU/memory performance problems? Maybe even some heapdump in windbg/sos stuff. Maybe a look under the hood of how .NET heap objects work. Maybe you could pull in Tess or Maoni for that?

  • @HG-Dev
    @HG-Dev 2 หลายเดือนก่อน +1

    I wager many will appreciate the attention given to the issue of analysis paralysis. Perhaps it's for the best that multi-threaded resource sharing largely goes over my head...

  • @sajadmalik9097
    @sajadmalik9097 2 หลายเดือนก่อน +4

    Next in the series:
    - Deep dive into garbage collector.
    - an even deeper dive into garbage collector.
    Please... I am really looking forward to this topic..
    Anyone else wants to learn GC from @SthephenToub.

  • @hahnkev
    @hahnkev 2 หลายเดือนก่อน +1

    Can't wait for that performance blog post for dotnet 9!

  • @mrqbboy
    @mrqbboy หลายเดือนก่อน

    Thanks Guys. This is the best programming content I've enjoyed this year.

  • @leknyzma
    @leknyzma 2 หลายเดือนก่อน +2

    I thought you stopped...welcome back Task.Run()

  • @RJiiFin
    @RJiiFin 2 หลายเดือนก่อน +1

    Really like these deep dives! Thank you

  • @DarthAffe
    @DarthAffe 2 หลายเดือนก่อน +1

    Again a great episode!
    For the future I'd be really interested in a episode about boxing, as there are some quite hidden pitfalls that can cause high GC pressure. Things like interfaces on value types, equality checks and maybe more common, but non obvious problems?
    Btw: Really looking forward to the yearly Performance Improvements blog post :)

  • @clashclan4739
    @clashclan4739 2 หลายเดือนก่อน

    We want more topics covered from stephen than others

  • @gavincampbell1061
    @gavincampbell1061 2 หลายเดือนก่อน +1

    If the array returned from the pool could be up to almost twice the size requested, I take it when iterating the array we should only ever go up to the length we requested as the rest could be garbage data?
    Being aware that the array's length is actually the next power of 2 we could populate the full array if we wanted to, but if you did a for loop with the end condition being the array's length, you could exceed your original requested length, which you may not have populated.
    Sorry if that was mentioned in the video and I missed it.
    Thanks for the videos, they're really useful and insightful.

    • @vyrp
      @vyrp 2 หลายเดือนก่อน +4

      Yes, you need to be careful. That's a common mistake. My tip would be use AsSpan() on the returned pooled array as soon as possible and only working on the span: `var span = arrayFromPool.AsSpan(0, requestedLength);`

  • @Dustyy01
    @Dustyy01 2 หลายเดือนก่อน +2

    Finally a new Episode 🎉🔥

  • @mehmetck
    @mehmetck 2 หลายเดือนก่อน

    I listened like Stephen’s dog 😅 We love this series please do more often

  • @secvbulrep
    @secvbulrep หลายเดือนก่อน

    We need more!!! Thnks a lot!

  • @CuriouslyContent
    @CuriouslyContent 2 หลายเดือนก่อน

    Always learning from you two! Keep up the great content!

  • @rodrigolima206
    @rodrigolima206 2 หลายเดือนก่อน

    Another very nice explanation, as always. Thanks.

  • @aguilaaudax1362
    @aguilaaudax1362 2 หลายเดือนก่อน +2

    First time ever Microsoft is actually teaching something

    • @shanselman
      @shanselman 2 หลายเดือนก่อน +5

      I’ve been here putting out content for 17 years, I’m gonna go ahead and say that this was not the first time 😂

  • @SohaibHasan
    @SohaibHasan 2 หลายเดือนก่อน

    Very informative! Thank you.

  • @Findalfen
    @Findalfen หลายเดือนก่อน

    Would love to have Maoni Stephens come to the show to talk a bit about the GC.

  • @LycosLinz
    @LycosLinz 2 หลายเดือนก่อน +1

    @StephenToub Around 44:28 in the video, I was wondering, why isn't there an overload like `bool TryRent(int minimumLength, out T[] array)` where you can decide not to allocate at all and use some other slower path that is still significantly faster than allocating a fresh new array?

  • @majixx
    @majixx 2 หลายเดือนก่อน

    Yet another gem!

  • @Spirch
    @Spirch 2 หลายเดือนก่อน +2

    i like it, only issue is there is a lot of small mic cut while talking, if you fix this next time

  • @cccyberfamilydk
    @cccyberfamilydk 2 หลายเดือนก่อน

    Great as usual.

  • @rb9238
    @rb9238 2 หลายเดือนก่อน

    Excellent!

  • @DotnetareaBr
    @DotnetareaBr 11 วันที่ผ่านมา

    A gold mine.

  • @禹睿陈-z5i
    @禹睿陈-z5i 2 หลายเดือนก่อน

    Wow!!!!!!!!!!!!!!!!!!!!
    It's been a century since the last update

  • @TheOneAndOnlySecrest
    @TheOneAndOnlySecrest 2 หลายเดือนก่อน

    I would have liked an explanation why default collections like a List do not use ArrayPool.
    As lists usually grow over time it would be a nice use case for a pool to avoid a lot of allocations or not?

  • @naveenkp7849
    @naveenkp7849 2 หลายเดือนก่อน +1

    Why can’t we have more of Stephen’s

  • @yairvogel6282
    @yairvogel6282 หลายเดือนก่อน

    21:09 "I love it when copilot just does stuff for me. Especially when I'm going to delete the code after"😂

  • @AmirHosseini-ow6oi
    @AmirHosseini-ow6oi 2 หลายเดือนก่อน

    Amazing ❤

  • @alucard2876
    @alucard2876 2 หลายเดือนก่อน

    Finally!!!

  • @knkootbaoat6759
    @knkootbaoat6759 2 หลายเดือนก่อน

    thanks for the pools.
    opps i mean show

  • @dtienloi
    @dtienloi 2 หลายเดือนก่อน +4

    Copilot completion is distracting…

    • @vyrp
      @vyrp 2 หลายเดือนก่อน

      Agree

  • @bity-bite
    @bity-bite 2 หลายเดือนก่อน

    19:46 Why not use uint instead?

  • @mohanrajaloganathan5587
    @mohanrajaloganathan5587 2 หลายเดือนก่อน

    When async call is made for network request, how operating system invokes back dotnet runtime when the network request gets completed?
    Could you go even deeper and explain, how a normal async httpcall or system timer gets registered with epoll (in linux)?
    Can you write a simple timer which registers with operating system and gets invoked by operating system?

    • @vyrp
      @vyrp 2 หลายเดือนก่อน

      In Windows, look for IO Completion Ports (IOCP) and overlapped IO.

  • @TodorTsankov-vz3sd
    @TodorTsankov-vz3sd 2 หลายเดือนก่อน

    🎉🎉

  • @gregorifelicio6030
    @gregorifelicio6030 2 หลายเดือนก่อน

    ❤❤❤❤

  • @superpcstation
    @superpcstation 2 หลายเดือนก่อน

    13:40 does anybody know why he assigned the global variable to local first?

    • @vyrp
      @vyrp 2 หลายเดือนก่อน

      Are you talking about `T? item = _item;`?
      It's because we need to make _item null before returning. Look at lines 18 and 19 at 13:52.

  • @gilbertsenyonjo963
    @gilbertsenyonjo963 2 หลายเดือนก่อน

    Hi. At 17:53, what does ??= mean? I cant find it on google

    • @vyrp
      @vyrp 2 หลายเดือนก่อน

      `a ??= b;` means `if (a is null) a = b;`
      Search for "C# null-coalescing assignment".

    • @michaldivismusic
      @michaldivismusic หลายเดือนก่อน

      It means if the left side is null, assign the right side to it. Otherwise, do nothing. Basically this:
      if (left is null)
      {
      left = right;
      }

  • @programmerstalks7196
    @programmerstalks7196 2 หลายเดือนก่อน +1

    It's a really awesome topic to bathe in.. 🚿 yeah

  • @JobertoDiniz
    @JobertoDiniz หลายเดือนก่อน

    I lack the basic knowledge of why would I use arraypool in first place. It allocates 30 concurrentqueues

  • @troncek
    @troncek 2 หลายเดือนก่อน

    Dogo at 22:06. :)

  • @Kitulous
    @Kitulous 2 หลายเดือนก่อน

    33:47 deficiency cores? yes these are definitely what efficiency cores are haha

  • @shawncicoria
    @shawncicoria 2 หลายเดือนก่อน

    good to see the Doodle passed out on the couch. That's where they belong!!!

  • @deivycode
    @deivycode 2 หลายเดือนก่อน

    Les't talk about GC

  • @bity-bite
    @bity-bite 2 หลายเดือนก่อน

    19:46 Why not use uint instead?

    • @vyrp
      @vyrp 2 หลายเดือนก่อน

      My guess would be because int is CLS compliant, while uint is not. That matters while building the standard library and not while building your own library, but I guess Stephen is used to working on the standard library.
      CLS compliance matters because .NET code can be called by many different languages, some of which might not have the concept of unsigned integer.