Click here to Skip to main content
15,168,105 members
Articles / Programming Languages / C#
Posted 11 Feb 2019

Tagged as



Are Speed Considerations Concerning List Still Important (Performance of Loyc's AList<T>)?

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
11 Feb 2019CPOL2 min read
Compare the speed of generic collections running on .NET Framework 4.6.1, .NET Core 2.1 and Mono/.NET 4.5 based on the framework's version of List against Loys's version of AList.


Recently, I was looking for a fast list and stumbled upon Loyc's AList<T>.

The AList<T> is part of a bunch of generic collection classes, that have been introduced here at Code Project already by Qwertie. In this tip, you'll find a simple comparison of performance, which I have missed in the original article.


The generic collection classes of the .NET standard library do a very good job, especially:

  • for small and medium size collections and
  • primarily for element read access and append operations

Conversely, they tend to be less suitable:

  • for large lists and
  • insert-at or remove-at (random access) operations

Let's take a look at the performance...

Using the Code

I have prepared three solutions (.NET Framework 4.6, .NET Core 2.1 and Mono/.NET 4.5) with exactly the same test case - random access insert-at and delete-at operations. This is the only scenario, that is worth inspecting - in all other cases, the .NET standard library is the best choice.

Loyc's AList<T> is available as NuGet package, compiled for 'Any CPU' targeting .NET 4.5, and source code at GitHub, that supports multiple targets: ,NET 3.5, .NET 4.0 and .NET 4.5.

It is easy to integrate the NuGet packages into the .NET Framework 4.6.1 and the Mono/.NET 4.5 projects. To get Loyc's AList<T> running for .NET Core 2.1, I had to adopt the source code - but this was done in less than 10 minutes as well.

The performance comparison (linear scale - to get an impression of the difference between best and worst):

Image 1

The performance comparison (logarithmic scale - to display even the small figures):

Image 2

The raw figures:

Image 3

How it looks running on Mono/.NET 4.5 (I've used VMWare Player 12.5.9 to run an openSUSE 13.3 64 Bit with 4GB RAM and 2 cores on an Intel(R) Core(TM) i7-5600U CPU):

Image 4

How it looks running on .NET Framework 4.6.1 (I've used the same Intel(R) Core(TM) i7-5600U CPU):

Image 5

How it looks running on .NET Core 2.1 (I've used the same Intel(R) Core(TM) i7-5600U CPU):

Image 6

The Quintessence

  • Mono/.NET4.5 is the slowest environment for large list. Loyc performs very well in this scenario and is a good alternative.
  • .NET Core 2.1 outperforms Loyc.
  • .NET Framework 4.6.1 is better than Mono/.NET4.5 and worse than .NET Core 2.1. Loyc performs very well in this scenario and is a good alternative.


  • 11th February, 2019: Initial version


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Steffen Ploetz
CEO Ploetz + Zeller GmbH
Germany Germany
No Biography provided

Comments and Discussions

QuestionScales of the graphs are not clearly labeled Pin
markchagers12-Feb-19 21:57
Membermarkchagers12-Feb-19 21:57 
I found it hard to see what the data in the graphs represent, there is no indication whether the horizontal scal is time used or number of operations. Not even a "smaller is better" pointer. I had to read the article to interpret the graphs properly, but maybe that is intentional? Wink | ;)
QuestionThe URL link is missing Pin
Fanliver11-Feb-19 17:41
MemberFanliver11-Feb-19 17:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.