Custom Collections - Still Worth the Extra Work?

Excuse me if I turn off my terminology, I only have about 2.4 years of programming experience, mostly in .NET.

I am currently one of two .NET developers in the mainframe store, the other developer sets the standards and is a great coder with a lot of experience and a degree of CS (I am a 100% tutorial).

We use custom collections for each application, recently with .NET 2.0 I have it using generics, not ArrayLists, and the eyeball performance seems to do just fine. We have developed an automated program that uses SQLDMO to connect to databases and will create a Datalayer base layer and business layers for any objects that we would like, it also processes logical deletions and so on.

When is performance what you're optimizing for, when can you justify NOT using a custom collection and writing a special look for it? We currently use hardcoded varieties because everything we saw is much slower since most of the other options use mirrored or bloated / LINQ datasets (still slower than a year ago compared to user collections?).

Does anyone else work strictly with custom generic collections, rather than using a simple route? Is the performance sacrifice as significant as I was believed? Being that I am still at the detailed stages of my development career, I would say that the next logical step for me is to start testing myself, but I also wanted to get the opinion of other professionals ... So, how does everyone do it? Am I one of the only people who actually use custom collections in a much faster and easier to create solution?

All opinions would be greatly appreciated.

: , , . , , , , List (Of T), IComparable .

+3
8

, .

: , , , , , . , ( O (log n) O (1), O (n)).

, ( , wikipedia)

, Dictionary, , GetHashCode()

.Net(caveat: .Net 2.0) , , , .

PowerCollections, , , Sets MultiDictionaries. , , .

, - ( PowerCollection) ( , ). , , , , , , .Net . YMMV.

+4

, . a class CustomerList : List<Customer>. , , .

+4

. , . , Code Complete, , , . , , .

+3

. , , - . , , , .

+2

Generic, , List Dictionary. , , .

, , , .

Generics 2.0

+2

, , , . , . , , .

.

+1

.net 3.5 (List, Dictionary), , , . :

public static class Extensions
{
   public static Customer GetCustomerByName( this List<Customer> customers )
  {
    return customer;
  }
}

var customers = new List<Customer>();
customers.Add( new Customer());
var customer = customers.GetCustomerByName( "Smith" );
+1

I recently put together a series of situations (and benchmarks) where using custom collections can be valuable. It is not directly related to .NET, but, nevertheless, is its rather general consideration and it may be useful to decide which collection is best suited for a particular problem.

Array, Dictionary, Collections - Performance, Functionality, Reliability

0
source

Source: https://habr.com/ru/post/1698909/


All Articles