Click here to Skip to main content
15,901,373 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 11:21
mvahoney the codewitch18-Jan-24 11:21 
GeneralRe: In .NET enumeration is slow Pin
PIEBALDconsult18-Jan-24 11:34
mvePIEBALDconsult18-Jan-24 11:34 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 11:48
mvahoney the codewitch18-Jan-24 11:48 
GeneralRe: In .NET enumeration is slow Pin
Eddy Vluggen18-Jan-24 15:19
professionalEddy Vluggen18-Jan-24 15:19 
GeneralRe: In .NET enumeration is slow Pin
Kenneth Haugland18-Jan-24 11:30
mvaKenneth Haugland18-Jan-24 11:30 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 11:43
mvahoney the codewitch18-Jan-24 11:43 
GeneralRe: In .NET enumeration is slow Pin
Gerry Schmitz18-Jan-24 11:50
mveGerry Schmitz18-Jan-24 11:50 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 12:04
mvahoney the codewitch18-Jan-24 12:04 
If I don't care about access performance in general I will use IEnumerable<T> if I can rather than a collection.

The reason being is (A) I don't like to impose functionality I'm not going to use and enumerating a collection is the same as enumerating with IEnumerable. (B) Lazy loading isn't really doable with collections in most circumstances because of the presence of count. (C) Collections provide methods to modify them. I certainly don't like suggesting I will modify something I won't, so if i can take the immutable version for a read only function i will. (D) unbounded collections are not supported by .NET collections. You must know the count ahead of time.

My choice of switching to IList was improved index access performance. ICollection doesn't provide that.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix

GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 12:02
mvaGraeme_Grant18-Jan-24 12:02 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 12:05
mvahoney the codewitch18-Jan-24 12:05 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 12:08
mvaGraeme_Grant18-Jan-24 12:08 
GeneralRe: In .NET enumeration is slow Pin
Richard Andrew x6418-Jan-24 12:21
professionalRichard Andrew x6418-Jan-24 12:21 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 12:42
mvahoney the codewitch18-Jan-24 12:42 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 13:03
mvaGraeme_Grant18-Jan-24 13:03 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 13:07
mvahoney the codewitch18-Jan-24 13:07 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 13:16
mvaGraeme_Grant18-Jan-24 13:16 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 13:22
mvahoney the codewitch18-Jan-24 13:22 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 13:44
mvaGraeme_Grant18-Jan-24 13:44 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 13:49
mvahoney the codewitch18-Jan-24 13:49 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 13:58
mvaGraeme_Grant18-Jan-24 13:58 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 14:04
mvahoney the codewitch18-Jan-24 14:04 
GeneralRe: In .NET enumeration is slow Pin
Graeme_Grant18-Jan-24 14:28
mvaGraeme_Grant18-Jan-24 14:28 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 14:29
mvahoney the codewitch18-Jan-24 14:29 
GeneralRe: In .NET enumeration is slow Pin
honey the codewitch18-Jan-24 14:09
mvahoney the codewitch18-Jan-24 14:09 
GeneralRe: In .NET enumeration is slow Pin
obermd19-Jan-24 3:47
obermd19-Jan-24 3:47 

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.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   507 votes