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.
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
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.
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.
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!
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!
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.
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 :)
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.
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...
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 :)
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?
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.
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);`
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
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?
@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?
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?
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.
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.