WriteAsync .NET

Testing, coding, in that order.

EventSource and Span: take 3

Previously, we determined that mixing EventSource and Span is costly. Now it’s just a matter of finding the lowest cost. The last approach used an ArrayPool for all ETW strings. But remember that ETW events are capped at 64 KB.…

By Brian Rogers | 8 January, 2020 | diagnostics, performance | No Comments |
Read more

EventSource and Span: take 2

Last time, we talked about how EventSource and Span don’t really mix. ETW wants a null-terminated string for tracing and Span isn’t set up for that. It turns out this null terminator issue has been explored in some depth by…

By Brian Rogers | 7 January, 2020 | diagnostics, performance | No Comments |
Read more

EventSource and Span: take 1

Let’s say you’re living the zero-allocation, universal memory .NET life, and you need to trace some char data. The only problem is that you have a Span<char> and EventSource only supports string. What to do? We’ll start with a typical…

By Brian Rogers | 6 January, 2020 | diagnostics, performance | 1 Comment |
Read more

Let’s do DHCP: sockets

After our foray into DHCP options, we are ready for the last piece of the puzzle — actually sending and receiving data on a socket. First, we need to encode the high performance receive pattern. I’ve decided on an async…

By Brian Rogers | 1 January, 2020 | async, concurrency, design, performance, tdd | No Comments |
Read more

Let’s do DHCP: options

Last time we built our DHCP buffer with header fields. For a fully formed DHCP message, we also need to support DHCP options. Each option has a tag byte specifying its type, a length byte, and a number of data…

By Brian Rogers | 31 December, 2019 | design, performance, tdd | 1 Comment |
Read more

Let’s do DHCP: intro

We’ve been talking about high performance datagram scenarios but have so far used a contrived sample of sending mostly fixed size strings — not so realistic. That will change today, as we turn to one of the more famous datagram…

By Brian Rogers | 30 December, 2019 | design, performance, tdd | 4 Comments |
Read more

High performance datagramming: concurrency?

We’ve been looking at some tips and tricks for achieving high performance in a skeletal datagram server. And yet, the implementation so far is single threaded. This is fine if strict packet ordering must be maintained. But we’re talking about…

By Brian Rogers | 29 December, 2019 | async, concurrency, performance | 2 Comments |
Read more

High performance datagramming: heap?

Last time, we looked at an implementation of a datagram server with and without channels. The non-channel solution ultimately won out in terms of performance. But that’s not all we can do to squeeze every ounce of throughput from this…

By Brian Rogers | 28 December, 2019 | async, performance | 1 Comment |
Read more

High performance datagramming: channels?

You may have heard of System.IO.Pipelines, a set of classes to aid in writing high performance streaming server code. But what about datagram scenarios, e.g. using UDP? That would seem like a job for System.Threading.Channels. Let’s try it and do…

By Brian Rogers | 27 December, 2019 | async, performance | No Comments |
Read more

TKey performance indicators: custom types

Last time, we covered the effect of various primitive types (and string) for use as dictionary keys. Today we will see how custom types fare. Let’s start with a custom value type which simply wraps a string: We’ll use a…

By Brian Rogers | 30 July, 2019 | performance | 1 Comment |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress