Skip to content

Instantly share code, notes, and snippets.

@sudipto80
Created March 19, 2016 04:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudipto80/90d8a59e622d34093394 to your computer and use it in GitHub Desktop.
Save sudipto80/90d8a59e622d34093394 to your computer and use it in GitHub Desktop.
Index consumption
void Main()
{
List<Employee> testSet = new List<Employee> ();
for (int i = 0; i < 20000; i++)
{
testSet.Add(new Employee(Guid.NewGuid().ToString(),"345"));
}
Stopwatch w = new Stopwatch ();
w.Start();
var largeIndex = testSet.ToIndex("Name",3);
w.Stop();
largeIndex.Count.Dump("Large Index Size");
var time = w.ElapsedMilliseconds;
time.Dump("Time");
}
class Employee
{
public string Name { get; set; }
public string ID { get; set; }
public Employee(string n, string id)
{
Name = n;
ID = id;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment