.NET Memory Performance Analysis
https://github.com/Maoni0/mem-doc/blob/master/doc/.NETMemoryPerformanceAnalysis.md [github.com]
2020-09-10 02:58
tags:
development
dotnet
garbage-collection
investigation
malloc
perf
This document aims to help folks who develop applications in .NET with how to think about memory performance analysis and finding the right approaches to perform such analysis if they need to. In this context .NET includes .NET Framework and .NET Core. In order to get the latest memory improvements in both the garbage collector and the rest of the framework I strongly encourage you to be on .NET Core if you are not already, because that’s where the active development happens.
When I was writing this document I intended to introduce concepts like concurrent GC or pinning as needed by the explanation of the analysis. So as you read it, you’ll gradually come across them. If you already kind of knew what they are and are looking for explanation on a specific concept here are the links to them
source: HN
This Goes to Eleven - Decimating Array.Sort with AVX2
https://bits.houmus.org/2020-01-28/this-goes-to-eleven-pt1 [bits.houmus.org]
2020-04-09 23:39
tags:
best
cpu
csharp
dotnet
interactive
perf
programming
series
sorting
visualization
Let’s get in the ring and show what AVX/AVX2 intrinsics can really do for a non-trivial problem, and even discuss potential improvements that future CoreCLR versions could bring to the table.
Everyone needs to sort arrays, once in a while, and many algorithms we take for granted rely on doing so. We think of it as a solved problem and that nothing can be further done about it in 2020, except for waiting for newer, marginally faster machines to pop-up. However, that is not the case, and while I’m not the first to have thoughts about it; or the best at implementing it, if you join me in this rather long journey, we’ll end up with a replacement function for Array.Sort, written in pure C# that outperforms CoreCLR’s C++2 code by a factor north of 10x on most modern Intel CPUs, and north of 11x on my laptop. Sounds interesting? If so, down the rabbit hole we go…
Very well done.
Analysing .NET start-up time with Flamegraphs
https://mattwarren.org/2020/03/03/Analysing-.NET-Runtime-Startup-with-Flamegraphs/ [mattwarren.org]
2020-03-13 04:25
tags:
dotnet
perf
visualization
Recently I gave a talk at the NYAN Conference called ‘From ‘dotnet run’ to ‘hello world’: In the talk I demonstrate how you can use PerfView to analyse where the .NET Runtime is spending it’s time during start-up:
Research based on the .NET Runtime
http://www.mattwarren.org/2019/10/25/Research-based-on-the-.NET-Runtime/ [www.mattwarren.org]
2019-10-27 04:41
tags:
compsci
dotnet
jit
links
paper
Over the last few years, I’ve come across more and more research papers based, in some way, on the ‘Common Language Runtime’ (CLR). So armed with Google Scholar and ably assisted by Semantic Scholar, I put together the list below.
"Stubs" in the .NET Runtime
http://www.mattwarren.org/2019/09/26/Stubs-in-the-.NET-Runtime/ [www.mattwarren.org]
2019-09-26 20:14
tags:
article
compiler
csharp
dotnet
jit
programming
‘Stubs’, as they’re known in the runtime (sometimes ‘Thunks’), provide a level of indirection throughout the source code, there’s almost 500 mentions of them!
This post will explore what they are, how they work and why they’re needed.
.NET Internals Cookbook
https://blog.adamfurmanek.pl/2019/02/16/net-internals-cookbook-part-0/ [blog.adamfurmanek.pl]
2019-03-09 18:47
tags:
csharp
dotnet
programming
series
type-system
In this series I answer various .NET questions. Some of them are asked during interviews, some of them I see on the internet, some of them are completely made up. The goal is to provide short answer with links to references if needed. This is by no means a .NET tutorial or experts reference, this is just a bunch of useful answers to refresh your knowledge.
Some of this gets pretty deep actually.
source: L
Is C# a low-level language?
https://mattwarren.org/2019/03/01/Is-CSharp-a-low-level-language/ [mattwarren.org]
2019-03-01 16:30
tags:
csharp
cxx
dotnet
jit
perf
programming
Specifically, what happens when translating a C++ raytracer and trying to make it fast.
I started by simply porting the un-obfuscated C++ code line-by-line to C#. Turns out that this was pretty straight forward, I guess the story about C# being C++++ is true after all!!
source: L
An Exhausting List of Differences Between VB.NET & C#
https://anthonydgreen.net/2019/02/12/exhausting-list-of-differences-between-vb-net-c/ [anthonydgreen.net]
2019-02-12 20:31
tags:
csharp
dotnet
programming
Before I joined Microsoft I might have vaguely held that idea too and used it in arguments to push back against detractors or reassure someone. I understand its allure. It’s easy to grasp and very easy to repeat. But, working on Roslyn–the complete from-the-ground-up rewrite of both VB and C#–for 5 years, I came to understand how unequivocally false this idea really is. I worked with a team of developers and testers to re-implement from scratch every inch of both languages as well as their tooling in a huge multi-project solution with millions of lines of code written in both. And with so many developers switching back and forth between them, and a high bar for compatibility with the outputs and experiences of previous versions, and the need to faithfully represent every detailed nuance throughout a massive API surface area I got to be intimately familiar with the differences.
This list is not exhaustive. It’s exhausting. It’s not all the differences there are, it’s not even all the differences I’ve ever known, it’s just the differences I can remember off the top of my head until such time as I become too tired to go on; until I’m exhausted. If I or others run into or remember other differences I’ll gladly update this list after the fact.
"Stack Walking" in the .NET Runtime
http://www.mattwarren.org/2019/01/21/Stackwalking-in-the-.NET-Runtime/ [www.mattwarren.org]
2019-01-21 23:48
tags:
dotnet
investigation
programming
systems
The CLR makes heavy use of a technique known as stack walking (or stack crawling). This involves iterating the sequence of call frames for a particular thread, from the most recent (the thread’s current function) back down to the base of the stack.
The rest of this post will explore what it is, how it works and why so many parts of the runtime need to be involved.
Announcing .NET Core 3 Preview 1 and Open Sourcing Windows Desktop Frameworks
https://blogs.msdn.microsoft.com/dotnet/2018/12/04/announcing-net-core-3-preview-1-and-open-sourcing-windows-desktop-frameworks/ [blogs.msdn.microsoft.com]
2018-12-05 03:24
tags:
beta
development
dotnet
ux
windows
Today, we are excited to announce that are open sourcing WPF, Windows Forms, and WinUI, so the three major Windows UX technologies will be open sourced. For the first time ever, the community will be able to see the development of WPF, Windows Forms, and WinUI happen in the open and we will take contributions for these frameworks on .NET Core. The first wave of code will be available in GitHub today and more will appear over the next few months.
Fuzzing the .NET JIT Compiler
http://www.mattwarren.org/2018/08/28/Fuzzing-the-.NET-JIT-Compiler/ [www.mattwarren.org]
2018-08-28 21:03
tags:
compiler
csharp
dotnet
fuzzing
jit
I recently came across the excellent ‘Fuzzlyn’ project, created as part of the ‘Language-Based Security’ course at Aarhus University. As per the project description Fuzzlyn is a: … fuzzer which utilizes Roslyn to generate random C# programs
https://github.com/jakobbotsch/Fuzzlyn
Announcing F# 4.5
https://blogs.msdn.microsoft.com/dotnet/2018/08/14/announcing-f-4-5/ [blogs.msdn.microsoft.com]
2018-08-15 03:52
tags:
dotnet
fsharp
functional
release
The first thing you may notice about F# 4.5 is that it’s higher than F# 4.1.
Performance Improvements in .NET Core 2.1
https://blogs.msdn.microsoft.com/dotnet/2018/04/18/performance-improvements-in-net-core-2-1/ [blogs.msdn.microsoft.com]
2018-05-10 16:25
tags:
benchmark
csharp
dotnet
perf
update
Back before .NET Core 2.0 shipped, I wrote a post highlighting various performance improvements in .NET Core 2.0 when compared with .NET Core 1.1 and the .NET Framework. As .NET Core 2.1 is in its final stages of being released, I thought it would be a good time to have some fun and take a tour through some of the myriad of performance improvements that have found their way into this release.
How we doubled Mono’s Float Speed
http://tirania.org/blog/archive/2018/Apr-11.html [tirania.org]
2018-04-28 21:09
tags:
benchmark
dotnet
perf
programming
update
I decided to look at what was going on, and document possible areas for improvement. As a result of this benchmark, and looking into this problem, we identified three areas of improvement:
Taking a look at the ECMA-335 Standard for .NET
http://www.mattwarren.org/2018/04/06/Taking-a-look-at-the-ECMA-335-Standard-for-.NET/ [www.mattwarren.org]
2018-04-14 18:50
tags:
dotnet
programming
standard
The rest of this post will take a look at the standard, exploring the contents and investigating what we can learn from it (hint: lots of low-level details and information about .NET internals)
How generics were added to .NET
http://mattwarren.org/2018/03/02/How-generics-were-added-to-.NET/ [mattwarren.org]
2018-03-22 16:48
tags:
compsci
csharp
dotnet
jit
programming
type-system
Before we dive into the technical details, let’s start with a quick history lesson, courtesy of Don Syme who worked on adding generics to .NET and then went on to design and implement F#, which is a pretty impressive set of achievements!
There are some significant differences between the Rotor source code and the real .NET framework. Most notably the JIT and GC are completely different implementations (due to licensing issues, listen to DotNetRocks show 360 - Ted Neward and Joel Pobar on Rotor 2.0 for more info). However, the Rotor source does give us an accurate idea about how other core parts of the CLR are implemented, such as the Type-System, Debugger, AppDomains and the VM itself. It’s interesting to compare the Rotor source with the current CoreCLR source and see how much of the source code layout and class names have remained the same.
Announcing .NET Core 2.1 Preview 1
https://blogs.msdn.microsoft.com/dotnet/2018/02/27/announcing-net-core-2-1-preview-1/ [blogs.msdn.microsoft.com]
2018-03-09 18:28
tags:
beta
csharp
dotnet
programming
release
.NET Core 2.1 Roadmap
https://blogs.msdn.microsoft.com/dotnet/2018/02/02/net-core-2-1-roadmap/ [blogs.msdn.microsoft.com]
2018-02-07 02:44
tags:
csharp
dotnet
update
We have been thinking of .NET Core 2.1 as a feedback-oriented release after the more foundational .NET Core 2.0 release. The following improvements are based on some of the most common feedback.
Resources for Learning about .NET Internals
http://mattwarren.org/2018/01/22/Resources-for-Learning-about-.NET-Internals/ [mattwarren.org]
2018-01-23 14:07
tags:
compiler
csharp
dotnet
jit
links
perf
programming
type-system
I wouldn’t recommend reading through the entire list, at least not in one go, your brain will probably melt. Picks some posts/topics that interest you and start with those.
.NET Instrumentation via MSIL bytecode injection
http://phrack.org/papers/dotnet_instrumentation.html [phrack.org]
2018-01-15 14:47
tags:
dotnet
fsharp
jit
programming
In this article we will explore the internals of the .NET framework with the purpose of providing an innovative method to instrument .NET programs at runtime.
source: grugq