Click here to Skip to main content
15,513,655 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 23:48
Calin Negru15-Aug-22 23:48 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 1:00
mveOriginalGriff16-Aug-22 1:00 
GeneralRe: VS 2022 a genuine wow moment Pin
pkfox16-Aug-22 1:55
professionalpkfox16-Aug-22 1:55 
GeneralRe: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 2:33
Calin Negru16-Aug-22 2:33 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 2:56
mveOriginalGriff16-Aug-22 2:56 
General[edit]Re: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 9:15
Calin Negru16-Aug-22 9:15 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 9:24
mveOriginalGriff16-Aug-22 9:24 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
OriginalGriff16-Aug-22 10:21
mveOriginalGriff16-Aug-22 10: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 5:54
Calin Negru17-Aug-22 5:54 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
OriginalGriff17-Aug-22 6:56
mveOriginalGriff17-Aug-22 6:56 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment[edited] Pin
Calin Negru17-Aug-22 7:27
Calin Negru17-Aug-22 7:27 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 21:04
mveOriginalGriff16-Aug-22 21:04 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
Matt Bond17-Aug-22 4:14
Matt Bond17-Aug-22 4:14 
GeneralRe: [edit]Re: VS 2022 a genuine wow moment Pin
Calin Negru17-Aug-22 7:30
Calin Negru17-Aug-22 7:30 
GeneralRe: VS 2022 a genuine wow moment Pin
Calin Negru16-Aug-22 3:15
Calin Negru16-Aug-22 3:15 
GeneralRe: VS 2022 a genuine wow moment Pin
Richard MacCutchan16-Aug-22 3:16
mveRichard MacCutchan16-Aug-22 3:16 
GeneralRe: VS 2022 a genuine wow moment Pin
OriginalGriff16-Aug-22 3:19
mveOriginalGriff16-Aug-22 3:19 
GeneralRe: VS 2022 a genuine wow moment Pin
Marc Clifton16-Aug-22 2:00
mvaMarc Clifton16-Aug-22 2:00 
GeneralRe: VS 2022 a genuine wow moment Pin
Greg Utas16-Aug-22 2:16
mveGreg Utas16-Aug-22 2:16 
GeneralRe: VS 2022 a genuine wow moment Pin
Marc Clifton16-Aug-22 6:38
mvaMarc Clifton16-Aug-22 6:38 
GeneralRe: VS 2022 a genuine wow moment Pin
Matt Bond17-Aug-22 4:16
Matt Bond17-Aug-22 4:16 
GeneralRe: VS 2022 a genuine wow moment Pin
dandy7216-Aug-22 4:32
dandy7216-Aug-22 4:32 
GeneralRe: VS 2022 a genuine wow moment Pin
dan!sh 16-Aug-22 4:57
professional dan!sh 16-Aug-22 4:57 
GeneralRe: VS 2022 a genuine wow moment Pin
Daniel Pfeffer16-Aug-22 5:27
professionalDaniel Pfeffer16-Aug-22 5:27 
GeneralRe: VS 2022 a genuine wow moment Pin
k505416-Aug-22 6:06
mvek505416-Aug-22 6: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.


Straw Poll

An amazing AI programming tool is invented that can do one task perfectly. What would you choose?
  Results   767 votes