How to invalidate cache when benchmarking?
- by Michael Buen
I have this code, that when swapping the order of UsingAs and UsingCast, their performance also swaps.
using System;
using System.Diagnostics;
using System.Linq;
using System.IO;
class Test
{
const int Size = 30000000;
static void Main()
{
object[] values = new MemoryStream[Size];
UsingAs(values);
…