RSSAmplifier

Blog

Philosophical Geek

Code and musings by Ben Watson

philosophicalgeek.comRSS feed ↗20 posts

Latest posts

Announcing: Microsoft.IO.RecyclableMemoryStream 1.3.0

It s a long time coming, but I ve finally released the next version of Microsoft.IO.RecyclableMemoryStream! Links Code Nuget Package What s New Bug Fixes Removed a buggy and unnecessary boundary check in Write methods. (927e173, benmwatson) Performance Removed LINQ iteration in some properties (ffe469c, ndrwrbgs) Overloads of Read, SafeRead, and Write that accept Span byte> arguments (.NET Core […

How to Write and Publish a Technical Book and Not Lose Your Sanity

Earlier this year, I published my third book, Writing High-Performance .NET Code (2nd Edition), my second that was fully self-published. In this article I want to detail a topic that I found incredibly under-documented as I went through the process of writing this revision: the technical process of managing a book s manuscript. This won t cover [ ] The post How to Write and Publish a Technical…

Sample Chapter of Writing High-Performance .NET Code, 2nd Edition

Head on over to http://www.writinghighperf.net to read a sample chapter of Writing High-Performance .NET Code, 2nd Edition. The sample PDF also includes some of the front and back material to give you a taste for the rest of the book. The post Sample Chapter of Writing High-Performance .NET Code, 2nd Edition first appeared on Philosophical Geek .

.NET Rocks covers .NET Performance!

I was recently on .NET Rocks!. Carl and Richard were great. Go here to listen to us discuss a bunch of perf stuff. The post .NET Rocks covers .NET Performance! first appeared on Philosophical Geek .

Writing High-Performance .NET Code on the No Dogma podcast

I was recently interviewed by the wonderful Bryan Hogan for his No Dogma podcast. Check out the episode here. If you want to subscribe, which you should, podcast feed is here. You can follow Bryan or myself on Twitter. Check it out! We had a great discussion about performance, Bing, Azure, and more. The post Writing High-Performance .NET Code on the No Dogma podcast first appeared on Philosophical…

Announcing Writing High-Performance .NET Code, 2nd Edition!

The new book will be available for sale on or around May 1, 2018. You can pre-order right now for Kindle in many Amazon markets, and for print as well in the US. The book is out! Get it in the US, or go here for more markets and options. The new book is a mix [ ] The post Announcing Writing High-Performance .NET Code, 2nd Edition! first appeared on Philosophical Geek .

Don’t Make This Dumb Locking Mistake

What’s wrong with this code: try { if (!Monitor.TryEnter(this.lockObj)) { return; } DoWork(); } finally { Monitor.Exit(this.lockObj); } This is a rookie mistake, but sadly I made it the other day when I was fixing a bug in haste. The problem is that the Monitor.Exit in the finally block will try to exit the lock, [ ] The post Don’t Make This Dumb Locking Mistake first appeared on Philosophical…

Free Kindle version of Writing High-Performance .NET Code when you buy the print version

As of last week, when you buy the print version of Writing High-Performance .NET Code from Amazon, you can get the Kindle version for free. The post Free Kindle version of Writing High-Performance .NET Code when you buy the print version first appeared on Philosophical Geek .

Get Your Thread Synchronization Right the First Time

I was recently debugging a problem that just didn’t make any sense at first. The code looked like this: class App { public bool IsRunning {get; set;} private Thread houseKeepingThread; public void Start() { this.IsRunning = true; this.houseKeepingThread = new Thread(ThreadFunc); this.houseKeepingThread.Start(); } private void [ ] The post Get Your Thread Synchronization Right the First Time first…

Announcing Microsoft.IO.RecycableMemoryStream

It is with great pleasure that I announce the latest open source release from Microsoft. This time it’s coming from Bing. Before explaining what it is and how it works, I have to mention that nearly all of the work for actually getting this setup on GitHub and preparing it for public release was done [ ] The post Announcing Microsoft.IO.RecycableMemoryStream first appeared on Philosophical Geek .

2014 Year In Review

Just a recap of the things that have occurred this year. I have been truly blessed, and I have lot to be thankful for. Just a small part of them here… Writing High-Performance .NET Code was published! I spent the first half of the year heads down and working on the book until it was [ ] The post 2014 Year In Review first appeared on Philosophical Geek .

Buy EPUB and PDF of Writing High-Performance .NET Code and Save 25%

My book Writing High-Performance .NET Code is already pretty inexpensive by programming book standards, but I’ve added a new deal. If you want to do get both the PDF and the EPUB, you can get 25% off the entire order, which basically makes one of them over 50% off. Just go to http://www.writinghighperf.net/buy, add both [ ] The post Buy EPUB and PDF of Writing High-Performance .NET Code and Save…

Digging Into .NET Loop Performance, Bounds-checking, Iteration, and Unrolling

Introduction In this article I am going to go into detail about how .NET treats loops involving array and collection access and what kinds of optimizations you can expect. I had mentioned some of these in a previous article, but in this article, we’re going to go deep and see many more examples. We re going [ ] The post Digging Into .NET Loop Performance, Bounds-checking, Iteration, and Unrolling…

Tips for Writing a Programming Book

In this article, I want to go through the process of writing a book, to give others who are thinking of writing a general idea of what kinds of things you will need to do. This is the article I wish I had read before starting out. Some of this will be applicable to fiction [ ] The post Tips for Writing a Programming Book first appeared on Philosophical Geek .

Book Review: High-Performance Windows Store Apps

I recently read Brian Rasmussen’s book High-Performance Windows Store Apps, and I think it’s an excellent companion to my own Writing High-Performance .NET Code. It’s a good companion because while my book is all about the nitty-gritty details of .NET and how they effect performance, I don’t go too much into things at the UI [ ] The post Book Review: High-Performance Windows Store Apps first…

Using MemoryStream to Wrap Existing Buffers: Gotchas and Tips

A MemoryStream is a useful thing to have around when you want to process an array of bytes as a stream, but there are a few gotchas you need to be aware of, and some alternatives that may be better in a few cases. In Writing High-Performance .NET Code, I mention some situations where you [ ] The post Using MemoryStream to Wrap Existing Buffers: Gotchas and Tips first appeared on Philosophical Geek…

50 Reasons You Should Be Using Bing

I frequently get asked by family, friends, and acquaintances why they should use Bing over our competitors. This post is a comprehensive answer to that question, as much as it can be. Note that I’m hardly an unbiased observer. I work for Bing, but I work deep in the layers that do the bulk of [ ] The post 50 Reasons You Should Be Using Bing first appeared on Philosophical Geek .

Appearance on .NET Rocks! Podcast

Carl and Richard put together a great podcast. .NET Rocks! has existed for years now and it’s amazing how many episodes they’ve published. A couple of weeks ago, I had the privilege of recording their latest episode with them, #1041. We talked about a ton of interesting things like the importance of memory management, precise [ ] The post Appearance on .NET Rocks! Podcast first appeared on…

Digging Into .NET Object Allocation Fundamentals

[Note: this article also appeared on CodeProject] Introduction While understanding garbage collection fundamentals is vital to working with .NET, it is also important to understand how object allocation works. It shows you just how simple and performant it is, especially compared to the potentially blocking nature of native heap allocations. In a large, native, multi-threaded [ ] The post Digging…

iTunes 11.4 not syncing/refreshing podcasts? How I resolved it

In general, I try to avoid Apple products when I can, but I do use and enjoy and iPod Nano for podcasts. With the recent update to 11.4 I noticed that my podcasts were not refreshing, either on a schedule or on-demand. I tried restarting iTunes, unplugging the iPod, restarting the computer – nothing. Until [ ] The post iTunes 11.4 not syncing/refreshing podcasts? How I resolved it first appeared…