FileStream internal buffer and some non-intuitive behavior [Ravi Krishnaswamy]

I recently came across a bug in FileStream’s internal buffer where the behavior is non-intuitive, so I thought I would discuss it.   Filestream uses one internal buffer for both reading and writing (scary but memory efficient). Unfortunately, this means you need to understand the behavior to avoid some issues (especially for non-seekable streams for…

1

PerformanceCounters: single instance, multi-instance and WMI [David Gutierrez]

Performance counter categories come in one of two modes: single instance and multi-instance.  If you want your category to be visible through WMI, it’s important to know the difference. A single instance category has only one machine wide value for each counter.  A good example of a category supplied by Windows is the “System” category. …

0

ResourceManager & new optimizations for MemoryStream & byte[] [Brian Grunkemeyer]

With Whidbey Beta 1, we’ve done some performance optimizations for Streams & byte[]’s stored in .resources files. The optimizations for byte[]’s are the relatively obvious ones – don’t use serialization, etc. The interesting change happened for MemoryStream. Instead of serializing a MemoryStream then deserializing it at runtime, we generally memory map the .resources file, then return an…

0

Number Formatting in .NET [Kit George]

We get an ongoing number of questions about formatting numbers in .NET. The documentation seems to be notoriously difficult to find. I thought I’d give a quick overview here, with a sample. First note for future reference: to find the write page in the documentation, type in “custom numeric format strings” or “standard numeric format…

9

Specification for Nullable [Kit George]

I thought I’d make the Nullable specification available to everyone, for reference, and in order to allow you to ask any questions/issues. This is about to go through an ECMA review as well, so it should be interesting to see what their issues/comments are. I’ve posted the specification on http://www.gotdotnet.com/team/clr/bcl/general/nullable2.doc. We’ll continue to make more…

8

Normalized paths are tricky [Brian Grunkemeyer]

A customer recently asked how to compare to see whether two paths refer to the same file, and he wanted to do this using a canonical path name.  This turns out to be a non-trivial problem.  Instead of talking about canonical path names which are somewhat expensive to get, we instead talk about normalized paths,…

6

SerialStream synchronous/asynchronous IO perf tweaks [Ravi Krishnaswamy]

In NT, System.IO.Ports.SerialStream synchronous Read()/Write() operations are done asynchronously. That is, for every Read() operation a BeginRead() is issued on a thread-pool thread and an immediate call to EndRead() waits for the operation to complete, creating a synchronous (blocking) semantic.   So every time you do a synchronous ReadByte(), you are paying for some asynchronous…

1

Some meeting notes [Kit George]

All, thought I would post some notes from a recent meeting we had with the WebData team. This is in relation to a Tree class they have created internally in their namespaces, and what we should consider doing with it. The reference to ‘our redblack’ tree reflects a type you’ll see in beta2. Tree: created…

10

Cleaning out the attic [Kit George]

Well all, I haven’t posted for a couple of weeks, and I thought I would share some fun with you, from an exercise we’re going through to clean up the libraries before we ship. Of course, we’re pretty aggressive about ensuring that we get a bunch of clean APIs (and of course, the odd thing…

4