Click here to Skip to main content
15,885,366 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: VS 2022 a genuine wow moment Pin
Calin Negru15-Aug-22 22:48
Calin Negru15-Aug-22 22:48 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 0:00
mveOriginalGriff16-Aug-22 0:00 
GeneralRe: VS 2022 a genuine wow moment Pin
pkfox16-Aug-22 0:55
professionalpkfox16-Aug-22 0:55 
GeneralRe: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 1:33
Calin Negru16-Aug-22 1:33 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 1:56
mveOriginalGriff16-Aug-22 1:56 
General[edit]Re: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 8:15
Calin Negru16-Aug-22 8:15 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 8:24
mveOriginalGriff16-Aug-22 8:24 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
OriginalGriff16-Aug-22 9:21
mveOriginalGriff16-Aug-22 9:21 
The edited bit ...
Whoo, that's a complicated one ... Lists are pretty efficient at what they do, but it depends on what you actually do with them - this may help: List<T> - Is it really as efficient as you probably think?[^]
So a List of Lists (of lists) could be more efficient than a monolithic list. Or it could be massively inefficient if you use it badly. But remember that as it's a class the collection(s) are storing, the memory occupied is the same whether it's an instance or a collection that it holds - the memory for the actual instance will be exactly the same size and number regardless, so nested collections may take up slightly more memory than a single one because of the extra references to collections involved. But only if you let the big one grow to size - otherwise the "double each time it's full" part of the equation starts to consume inordinate amounts of memory (and processing time to copy across as it goes).
But then when you use it, the flat model outperforms in it terms of processing, because there is less dereferencing going on.

And if you start storing the Fruit as a struct rather than a class to save space and dereferencing, you introduce a whole new kettle of fish because the size of the Fruit starts to impact space and processing when you copy it each time (value types) instead of copying the reference alone. And ... there is a limit on the size of the monolithic collection because of the .NET limit on max size of any one item, and an array of structs is a single chunk of memory n * sizeof(Fruit) bytes long instead of n * 4 or n * 8 bytes long for an array / list of references. Again, this might help: Using struct and class - what's that all about?[^]

It's never as simple as it seems, is it? Laugh | :laugh:

[edit]
Second link changed - I forgot to CTRL+C before pasting ... Blush | :O
[/edit]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!


modified 16-Aug-22 16:18pm.

GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
Calin Negru17-Aug-22 4:54
Calin Negru17-Aug-22 4:54 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
OriginalGriff17-Aug-22 5:56
mveOriginalGriff17-Aug-22 5:56 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
Calin Negru17-Aug-22 6:27
Calin Negru17-Aug-22 6:27 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 20:04
mveOriginalGriff16-Aug-22 20:04 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
Matt Bond17-Aug-22 3:14
Matt Bond17-Aug-22 3:14 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
Calin Negru17-Aug-22 6:30
Calin Negru17-Aug-22 6:30 
GeneralRe: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 2:15
Calin Negru16-Aug-22 2:15 
GeneralRe: VS 2022 a genuine wow moment Pin
Richard MacCutchan16-Aug-22 2:16
mveRichard MacCutchan16-Aug-22 2:16 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 2:19
mveOriginalGriff16-Aug-22 2:19 
GeneralRe: VS 2022 a genuine wow moment Pin
Marc Clifton16-Aug-22 1:00
mvaMarc Clifton16-Aug-22 1:00 
GeneralRe: VS 2022 a genuine wow moment Pin
Greg Utas16-Aug-22 1:16
professionalGreg Utas16-Aug-22 1:16 
GeneralRe: VS 2022 a genuine wow moment Pin
Marc Clifton16-Aug-22 5:38
mvaMarc Clifton16-Aug-22 5:38 
GeneralRe: VS 2022 a genuine wow moment Pin
Matt Bond17-Aug-22 3:16
Matt Bond17-Aug-22 3:16 
GeneralRe: VS 2022 a genuine wow moment Pin
dandy7216-Aug-22 3:32
dandy7216-Aug-22 3:32 
GeneralRe: VS 2022 a genuine wow moment Pin
dan!sh 16-Aug-22 3:57
professional dan!sh 16-Aug-22 3:57 
GeneralRe: VS 2022 a genuine wow moment Pin
Daniel Pfeffer16-Aug-22 4:27
professionalDaniel Pfeffer16-Aug-22 4:27 
GeneralRe: VS 2022 a genuine wow moment Pin
k505416-Aug-22 5:06
mvek505416-Aug-22 5:06 

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.