Created
March 19, 2016 04:14
-
-
Save sudipto80/90d8a59e622d34093394 to your computer and use it in GitHub Desktop.
Index consumption
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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