Why is OrderBy which returns IOrderedEnumerable<T> much faster than Sort?
问题 This is a follow up of this excellent question C# Sort and OrderBy comparison. I will use the same example: List<Person> persons = new List<Person>(); persons.Add(new Person("P005", "Janson")); persons.Add(new Person("P002", "Aravind")); persons.Add(new Person("P007", "Kazhal")); The methods in contention are: persons.Sort((p1, p2) => string.Compare(p1.Name, p2.Name, true)); //and persons.OrderBy(n => n.Name); Let me start by saying that I understand there isn't any significant performance