I agree it's strange that the List doesn't work like the typical Vector and thus doesn't come closer to array performance, but if you really have as many indexed operarations as your code snippet suggests, you're probably better off using a custom container implementation which gives you more finegrained control anyway.
Quote:Original post by SiCrane
So the List generic version is actually making function calls in the generated code.
The 1st call looks like a by-product of the fancy 'syntactical sugar' that .NET indexers are. The 2nd call probably is a call to the List.Count property to do index bounds checking. This would kinda prove my point that a container tailored to the OPs needs might be a better choice. Obviously a generic lib implementation needs bounds checking on each access to provide a robust container and sticks to .NET practices like indexers, but a specialist implementation could do this more efficiently and/or forego any checks completely for the sake of speed.
Well, hope this is of some consolation at least [smile]
[Edited by - remigius on July 23, 2007 2:38:19 AM]