C# Digest #399: Optimizing CPU-bound and memory-bound .NET applications: 11 best practices
#399 — January 24, 2022 | View in browser |
C# Digest
Spread the word, build the community, share the knowledge – invite your friends.
sponsor
Octopus Deploy easily automates your deployments and operations runbooks from a single place, helping you ship code quickly and reliably. Class-leading support for .NET applications on Windows Servers and Azure.
this week's favorite
Optimizing CPU-bound and memory-bound .NET applications: 11 best practices
Everything has its limit, right? A car can drive only so fast, a process can use only so much memory, and a programmer can drink only so much coffee. Our productivity is limited by our resources, but we have the ability to make better or worse use of them. The goal should be to use each of our resources as close to its limit as possible. We want to use every bit of our CPU and memory or else we're over-paying for expensive machines. But if we use too much of those resources, we run the risk of causing performance problems, unavailable service issues, and downright crashes. It's a tricky game to play and that's what we're going to talk about today.
Favor real dependencies for unit testing
Which dependencies should be present in your code base? This article suggests an answer to that question.
Deep introduction to .NET MAUI handlers architecture
In my last article, I did a deep introduction to .Net MAUI. For my first article of the year, we will have an introduction to .NET MAUI handlers. If you are a Xamarin dev, you should know about the “Renderers” architecture. Well, handlers are what replaced renderers when Xamarin Forms evolved to .NET MAUI. But there is so much more about handlers, and today we are here to explore that.
State of the Windows Forms Designer for .NET Applications
After reading this blog post you will be familiar with the underlying problems the new WinForms designer is meant to solve and have a high-level understanding of the primary components in this new approach. Enjoy this look into the designer architecture and stay tuned for future blogs!
Get C# metadata from a call site
C# is a statically typed language, and one of the greatest derived strengths is our ability to ask questions around our code. Whether you love it or hate it, reflection is a critical part of the .NET stack, and when you program long enough, you’re bound to run into it. What if I told you there are other ways to get information about your executing application? In this post, we’ll take a look at the Caller* family of attributes, which will allow you to get information like file path, line number, member name, and argument expression. You can find all of these methods in the System.Runtime.CompilerServices namespace.
courses
Free Course: Try IAC with Justin Mitchel
Learn the fundamentals of leading Infrastructure as Code (IaC) tools by deploying Docker-based Python web applications. Over 13 hours of free video content covering Terraform, Ansible, Salt (SaltStack), Puppet Bolt, and Chef. Available Now.
newsletters
Older messages
C# Digest #398: LINQ enhancements in Entity Framework Core 6
Sunday, January 16, 2022
And more news, tutorials and articles about C# and .NET in this week's issue. #398 — January 17, 2022 View in browser C# Digest Spread the word, build the community, share the knowledge – invite
C# Digest #397: Refactoring with C# 10
Sunday, January 9, 2022
And more news, tutorials and articles about C# and .NET in this week's issue. #397 — January 10, 2022 View in browser C# Digest Spread the word, build the community, share the knowledge – invite
C# Digest #396: Looking back at C#
Sunday, January 2, 2022
And more news, tutorials and articles about C# and .NET in this week's issue. #396 — January 03, 2022 View in browser C# Digest Spread the word, build the community, share the knowledge – invite
C# Digest #395: Microsoft .NET history
Sunday, December 26, 2021
And more news, tutorials and articles about C# and .NET in this week's issue. #395 — December 27, 2021 View in browser C# Digest Spread the word, build the community, share the knowledge – invite
C# Digest #393: Don't do that, do this: the .NET 6 edition
Sunday, December 12, 2021
And more news, tutorials and articles about C# and .NET in this week's issue. #393 — December 13, 2021 View in browser C# Digest Spread the word, build the community, share the knowledge – invite
You Might Also Like
Ranked | The Top Grossing Movies Worldwide in 2024 🎬
Saturday, January 11, 2025
Established IP dominated the 2024 box office, with top films mostly being sequels, spin-offs, or franchise continuations. View Online | Subscribe | Download Our App FEATURED STORY Ranked: Top Grossing
📖 Your Step-by-Step Guide to Securing AI in the Enterprise
Saturday, January 11, 2025
January 11, 2025 | Read Online Subscribe | Advertise Good Morning. Welcome to this special edition of The Deep View, brought to you in collaboration with Tines. When it comes to adopting AI securely,
🐍 New Python tutorials on Real Python
Saturday, January 11, 2025
Hey there, There's always something going on over at Real Python as far as Python tutorials go. Here's what you may have missed this past week: Iterators and Iterables in Python: Run Efficient
Life Update: Me. In Shorts. In Antarctica [Pics Inside 🧊]
Saturday, January 11, 2025
And yes, I jumped in. It taught me a lot 😅 ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏
Google Researcher Uncovers Zero-Click Exploit Targeting Android Devices
Saturday, January 11, 2025
THN Daily Updates Newsletter cover The Kubernetes Book: Navigate the world of Kubernetes with expertise , Second Edition ($39.99 Value) FREE for a Limited Time Containers transformed how we package and
📧 Working with LLMs in .NET using Microsoft.Extensions.AI
Saturday, January 11, 2025
Working with LLMs in .NET using Microsoft․Extensions․AI Read on: my website / Read time: 6 minutes The .NET Weekly is brought to you by: Transform your database performance with RavenDB:
iOS Dev Weekly – Issue 694
Friday, January 10, 2025
Hopefully you won't see that much difference with receiving this issue, but it's ALL CHANGED behind the scenes! 😱
Daily Coding Problem: Problem #1664 [Easy]
Friday, January 10, 2025
Daily Coding Problem Good morning! Here's your coding interview problem for today. This problem was asked by Twitter. A permutation can be specified by an array P , where P[i] represents the
Spyglass Dispatch: The Case for a For-Profit OpenAI
Friday, January 10, 2025
RIP Venu • A More Political and Real Time Threads • An OpenAI Auction • Apple's Tough 2025 The Spyglass Dispatch is a newsletter sent on weekdays featuring links and commentary on timely topics
⌨️ 10 Mods to Improve Your Mechanical Keyboard — How to Set Up Quick Share on Windows
Friday, January 10, 2025
Also: Why Are Tech Companies Trying to Sell Me Expensive Clocks? How-To Geek Logo January 10, 2025 Did You Know Famed biologist Charles Darwin and US President Abraham Lincoln were born on the same day