Friday, June 30, 2017

Recently some of my programmer friends and I discussed several technologies on our podcast, the QQ Cast. Would you like to learn how to start playing with Go? Do you know if your servers are right for containers? Have you ever wondered why front end JavaScript frameworks come and go on an annual basis? Come listen to us ramble, and maybe you can help us answer those questions!

Setup your Path - This is simply, but a significant paradigm shift from what I was used to a .NET developer. In short, you can have a single workspace for all of your projects, and this path variable is where that is located.

Install Gogland as your IDE - The pre-release Jetbrains IDE is already the best one on the market. I don't know if it's pronounced "go gland" or "gog land", but either way it's free!

Thursday, April 27, 2017

I recently added support for ASP.NET Core to my Tact.NET IOC Container, and I thought that I would share some of the interesting requirements I discovered while doing so. I had originally expected the default ASP.NET Core container would follow the same rules as the official Microsoft Unity container, but that turned out not to be the case!

1) Register is first in win.

The Unity container was last in win, and it would completely disregard the original registration. With ASP.NET Core you need to preserve the original registration and then treat all subsequent registrations as addition registrations that will only be resolved when ResolveAll is invoked, similar to keyed registrations in Unity. Which brings us to our next difference...

Thursday, March 30, 2017

I recently found out that string interpolation is not nearly as efficient as I would have thought. I also suspected that it was just doing a string concatenation, but it is actually doing a string format. This leads to a pretty significant performance degradation; the following test runs one million iterations of each.

Numberof Args

InterpolationMilliseconds

String.FormatMilliseconds

String.ConcatMilliseconds

String AddMilliseconds

StringBuilderMilliseconds

2

262

260

19

18

34

3

367

367

25

24

35

4

500

513

31

32

41

5

646

635

67

66

44

6

740

723

79

76

49

7

802

819

86

85

52

8

938

936

97

98

58

So, what's the lesson? Don't use string interpolation in high performance areas (such as your logger)!

Sunday, February 26, 2017

Visual Studio 2017 is literally only a few days away from release; so it might be a little late, but I finally figured out how to run .NET Core xUnit tests from ReSharper in VS2015! Good News: If you can't upgrade to VS2017 right away, then at least you can still run your unit tests!

Just make sure that the following is included in your project.json file (with the appropriate runtime):

Tuesday, January 31, 2017

As should be obviously from my recently blog posts, I have really been enjoying working with .NET Core. Clearly I am not alone, as a significant number of libraries have been porting over to the .NET Standard.

Below is a list libraries that have added support for the .NET Standard, meaning that they should be able to run cross platform on both Windows and Linux.

While I have not yet had the opportunity to try all of the libraries listed below, I have had great luck with the ones that I have tested, and I am simply ecstatic to see this list growing as fast as it is.

Sunday, January 29, 2017

.NET already comes with a nice collection of HttpContent serializers, but it lacks a JsonContent type. A common solution is to just serialize their payload to a JSON string and that insert that into an instance of StringContent. However, this means that you need to remember to set your headers, and it is a little bit inefficient because of how it creates multiple strings and buffers for each payload.

I have create a simple implementation of JsonContent that uses Json.NET and pooled memory streams. The result is between 2% and 10% faster, and causes ~50% fewer garbage collections.

Search This Blog

About Tom

Tom DuPont is a Software Engineer. He has been a tool at CodeSmith, made love at Match, and now makes war for Blizzard. He specializes in C#, ASP.NET, and even that crazy JavaScript stuff. His views and opinions are his own.

Listen to Tom

Tom is a host on the QQ Cast, where he helps answer geek culture's most superfluous questions.