The theme of Paint.NET v3.5 is … performance

February 5, 2009 – 1:01 am
I sat down to write some notes before starting this blog entry, and I wound up with two full pages in OneNote on the 1920x1200 monitor it was sitting in. The more I’ve been working on it the more I’m excited about the Paint.NET v3.5 release. It isn’t one that introduces a lot of really cool or big-ticket features, but the list of small improvements is really adding up. I’ve been able to do a lot of research and prototyping in esoteric areas of multithreading and concurrency, and have gained both more mastery and more fear for these topics. Performance work in Paint.NET v3.5 has wound up focusing on 3 areas: Scaling up. As everyone’s been saying for years, the future is increasingly multithreaded. My newest CPU upgrade leaves me with 8 threads in Task Manager (Intel Core i7 overclocked to 3.8GHz). A lot of research and work has gone into making ...

Mid-January Progress Update on Paint.NET v3.5

January 16, 2009 – 2:06 am
I think it’s best to quote a private-message between myself and Ed Harvey on the forums: I've got to stop breaking things before I start fixing them ... Paint.NET v3.5 is turning out to be more work than I originally anticipated! What started out as a “simple” rewrite of the selection rendering system has turned into a major refactor of large portions of the code base. I’m done a wholesale adoption of WPF’s mathematics primitives such as Point, Rect, Int32Rect, Vector, Size, and Matrix. These classes do a better job and are more consistent than GDI+’s Point, PointF, Rectangle, RectangleF, Matrix, etc. (I’m still befuddled as to why System.Drawing.Drawing2D.Matrix, which is six floats and 24 bytes, needs a Dispose() method. Give me a struct please.) The goal is to make sure that the entire data flow from the selection tools to the selection renderer is as performant as possible. Right now rendering ...

How to fix: Paint.NET “breaks” with Vista SP2 Beta

December 20, 2008 – 3:31 pm
I've had some reports that installing the Windows Vista SP2 beta (or "CPP") breaks Paint.NET v3.36. You'll get an error message like so: Contrary to the error, Paint.NET v3.36 does not require .NET Framework 3.5 SP1. There are two ways to fix this: 1. Install .NET Framework 3.5 SP1. I recommend doing this anyway, because it has numerous fixes and performance improvements that make Paint.NET happy. 2. Go to the directory you installed Paint.NET, and remove all the files with the ".exe.config" extension. This will un-confuse the .NET loader stuff. This seems to be something related to the .NET Client Profile, although I'm not sure what the root cause is. I'll be reporting this bug to the right people, so that it can be fixed.

Installing .NET 3.5 SP1: Please wait … Forever!

December 13, 2008 – 2:54 am
The very cool thing about Paint.NET v3.5 is that it installs quite fast on a fresh Windows XP SP2 machine. And that includes the installation of prerequisites like Windows Installer 3.1 and the Client Profile version of the .NET Framework 3.5 SP1. Even on my new little Atom 330 box* it is kind of pleasantly fast. I'd even say it's fun. (The unfortunate thing is that Paint.NET v3.5 is not yet out of "pre-alpha" ...) Intel BOXD945GCLF2 Atom 330 Mini ITX Motherboard/CPU Combo Intel BOXD945GCLF2 Atom 330 Intel 945GC Mini ITX Motherboard/CPU Combo Once you jump over to Windows Vista, the story becomes very very very very dire. It took a full hour to install .NET 3.5 SP1. The hard drive was thrashing and yelling the entire time, and CPU usage was quite high. In the middle of this, a Windows Update dialog popped up in the corner ...

Goodbye Pentium 4, Hello Atom

December 9, 2008 – 9:55 pm
Sadly, I fried my Pentium 4 test system a few days ago, which had proven invaluable in my performance testing of Paint.NET v3.5. I went to turn it on* and the screwdriver missed by a few millimeters, shorted the wrong pins, and ... bzzzt. No more P4. * Since this system was "bread boxed," meaning that it wasn't inside of a case or anything, turning it on involved shorting the two pins that the power button is normally wired directly straight to. Fortunately I have one of these on the way from newegg. Along with twenty dollars worth of RAM (2 GB), I will soon have a new performance test bed. It's a motherboard with a soldered-on Intel Atom 330 CPU for $80. It's dual-core, supports 64-bit, and has HyperThreading. And it runs in a small 8W power envelope (well, the CPU itself anyway). Think about it: for $80 you can get ...

Paint.NET v3.5: “Improved rendering quality when zoomed in”

December 7, 2008 – 5:28 pm
Brad Wolff recently wrote a comment on my earlier post, "Change of plans - here comes Paint.NET v3.5" : "Rick - You mentioned that 3.5 will have “Improved rendering quality when zoomed in”. Can you elaborate on this? My fear is that we will end up having to look at the blurred mess that Windows Picture Viewer displays when zoomed in. Please tell me I am wrong!" -- Brad Wolff Brad, you're wrong :) And it's in a good way. Paint.NET v3.5 does not use bilinear or bicubic resampling when zooming in, which is the cause of the blurred mess that you mention in Windows Picture Viewer. In fact, it is now using the same resampling algorightm for zooming in that has been employed for zooming out: rotated grid supersampling. The old resampling method was the simple nearest neighbor one. It was very fast, especially when paired with a lookup table for ...

A fluent approach to C# parameter validation

December 6, 2008 – 4:39 pm
Fluent programming gets a bad reputation, since some developers like to write code like the following: var time = 7.Days().Plus(4.Hours()) Barf. However, when used properly, I think it's very powerful. Let's look at a typical method with some parameter validation: // Copy src[srcOffset, srcOffset + length) into dst[dstOffset, dstOffset + length)public static void Copy<T>(T[] dst, long dstOffset, T[] src, long srcOffset, long length){    if (dst == null)        throw new ArgumentNullException("dst");    if (src == null)        throw new ArgumentNullException("src");    if (dstOffset + length > dst.Length || dstOffset < 0)        throw new ArgumentOutOfRangeException(            "dst, dstOffset, length",             string.Format("dst range is not within bounds, ({0} + {1}) > {2}", dstOffset, length, dst.Length));    if (srcOffset + length > src.Length || srcOffset < 0)        throw new ArgumentOutOfRangeException(            "src, srcOffset, length",             string.Format("src range is not within bounds, ({0} + {1}) > {2}", srcOffset, length, src.Length));    if (length < 0)        throw new ArgumentOutOfRangeException("length", "length must be >= 0, " + ...

What if XP SP3 were the minimum OS?

December 2, 2008 – 8:01 pm
Currently, the minimum version of Windows that Paint.NET will run on is XP SP2. Unfortunately, it's starting to show it's age and it's making a big hassle for the installer. The issue is that a "fresh" installation of XP SP2 does not have Windows Installer 3.1, whereas XP SP3 does. I have all sorts of custom code to detect this, and special packaging rules for creating my ZIP files and self-extractors. It adds about 2MB to the Paint.NET v3.5 download, although it greatly improves the user experience and reduces friction for getting our favorite freeware installed. I was hoping to get the .NET 3.5 Client Profile installer to auto-download Windows Installer 3.1, but unfortunately it has a hard block on this before it even starts to parse the Products.XML file which contains the installation manifest and logic. If I were to set the minimum system requirement to be XP SP3, ...

An exploit requiring admin privilege is NOT an exploit

November 15, 2008 – 1:53 pm
I'm going to pick on a post that I saw on the forum recently, "Root kits for .NET framework been found" [sic]. Now, I believe this person was just doing due diligence and reporting something they thought might honestly be important. So, "sharpy" (if that is your real name!), this is not meant as a dig on you. The post points to another forum discussion at dslreports.com, which then has some other links I'll let you explore yourself. In short, the author of some paper or exploit is claiming they have hacked the .NET Framework such that they can bypass strong-name validation, or replace code in mscorlib.dll, etc. I'll publish the first line of the first reply to the post on dslreports: "The 'exploit' starts with the modification of a framework dll (assembly) from outside the runtime using administrative privileges." Spot the refutal? I put it in bold :) It's like Raymond ...

October 2008 usage statistics

November 5, 2008 – 1:36 am
First, I'm very glad that Obama won the election. It was the first time I've ever voted, in fact. I think he will provide some much needed hope and invigoration. Congratulations! Anyway, on to the stats! I haven't posted on this since September 2007, and it's way long overdue for an update. Since then, usage of Paint.NET is up an amazing 222%. Wow! Vista share has grown a lot, from about 15% all the way up to almost 28%! The share of 64-bit users has also doubled, from 1.24% to 2.66%. Windows 7 is even making a peek-a-boo appearance, at 0.01% :) These are all very good indicators for me. The number of Russian users has grown significantly -- it used to be at 1.67%, but is now over 4.0%. Turkish share grew even more -- from 0.73% up to 3.0%. Standard disclaimer: As a reminder, these statistics represent hits to the auto-updater ...