Create a logger for watching your test progress as it runs.

  I was creating a project that’s a Windows Service, which has components running in multiple processes, using multiple threads and named pipes for communication. To understand the behavior of the code, I wanted to have accurate logging that: · The timing was very critical, so I wanted the log to show the sequence of…

0

Turn your tests into stress tests easily

It’s great to be able to write tests and execute them while developing a project. While I’m developing, I can hit a button and run the dozens of tests to see if I’ve broken anything. As code gets written lots of things get refactored, moved around, etc. Hitting a button to see if I broke…

0

Its easy to Create your own FrameWorkElement in WPF

Sometimes you want to have very fine control of how your application looks and behaves. Other times, you just want to draw something on your UI. It’s pretty easy to create your own control class and put instances of it on your form. The sample below create a new class MyFrameworkElement which allows you to…

0

The number of Garbage Collections indicate how much memory is used

One of the performance improvements we made in .Net was with System.Text.StringBuilder. StringBuilder is used in lots of code to build strings: it has various methods to modify strings quickly. Once a string is built, the ToString method is called to create the string. We observed via MemSpect that there were thousands of instances of…

0

Performance of Memory vs Disk

There is a comment on this Visual Studio Blog post (about how we made Visual Studio faster): “Focus on speed, not memory usage. Memory is very cheap, but CPU performance is muuuuuuuuch moooooooore expensive.” Yes, memory keeps getting cheaper, but actually, reducing memory use is critical to increasing the performance of any large application like…

0

Examine the layout of managed strings in memory

Suppose you wrote some C# code like this: var str1 = "ThisIsAString"; var str2 = "ThisIsAnotherString"; As you’d expect, each string is stored in the resulting built binary and also in memory when the binary is loaded, resulting in 2 separate strings. Now suppose you wrote this code instead: var str1 = "ThisIsAString"; var str2…

0

Increase the memory available to your tests

    I love having test projects included in my solutions. Software is alive. I’m constantly making improvements/changes/fixes. When I have customers asking for various features in my code, or for code improvements, being agile and able to publish a changed build with utmost confidence relies largely on a great set of tests that can…

1

Create multiple threads to see if work is done simultaneously

When you hear about threads and threading, you hear that they allow concurrent execution of code, which is supposed to lead to better performance. Most computers nowadays have more than one CPU, meaning that each CPU can be executing code at the same time. Hit Ctrl-Shift-Escape to bring up Task Manager, then switch to the…

0

Tetris

A long time ago I worked in the Green Building (building 54 at MIT).   Several NASA Apollo lunar missions (I think 11, 12, 14… I know it wasn’t 13 J ) placed seismometers on the moon, in various locations. They didn’t detect earthquakes. The Moonquakes were quite small but still measurable.   At a…

0

Examine your program’s available memory: is it leaking?

  Sometimes your program wakes up and finds itself running in an environment that might not be as suitable as you’d like.   For example, it might be distributed to a user running on a machine with not enough memory, and could be failing. Perhaps the failures occur because the user is running multiple applications…

0