Home | About | Search | RikReader
Thanks for using Microsoft Connect!

Product/Technology - Visual Studio and .NET Framework
Feedback ID - 284008
Feedback Title - Valuetypes are boxed in Array.BinarySearch(T[], T), Array.Sort(T[]), Comparer.Default and EqualityComparer.Default
The following fields or values changed:
Field Resolution changed from [Not Set] to [Not Reproducible]
Field Status changed from [Active] to [Resolved]

Are the testers incompetent or is it all in my head?

If anyone with an x64 machine would like to help confirm my sanity, could you compile and run the following program?

static class Test
{
    static void Main()
    {
        int[] ints = new int[] { 1 };

        while (true)
        {
            System.Array.BinarySearch<int>(ints, 1);
        }
    }
}

Fire up the "Performance Monitor" and add counters for (.NET CLR Memory):

  • Gen 0 Collections - a lot
  • % Time in GC - I'm seeing about 0.7%
  • Allocated Bytes/sec - about 400mb/s

I'm running Windows Vista Ultimate x64 on an E6600 with the x64 CLR 2.0.50727.

My theory for why it doesn't reproduce on x86? "secret magical JIT optimisation".

  • Programming