ikalou.
ikalou.
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
No description
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
I see. I though that's what it was called.
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
But SleepWellPupper's screenshot shows that this is not the case
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
I was thinking maybe when using a collection initializer the compiler (or whatever component has this job) might have set the capacity implicit to minimize operations
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
Thanks everyone. So I should specify the capacity manually in the constructor to accommodate for the number of elements if the collection initializer if the code is in a hot path.
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
My question is‚ when using a collection initializer with n elements‚ is new List<T>() {...} be as efficient as new List<T>(n) {...}. It would seem logical but I can't find the information nor do I know how to test it.
54 replies
CC#
Created by ikalou. on 7/26/2024 in #help
List, Collection Initializer and Capacity
I think the docs say new List<T> starts at 0 (instead of 4)?
54 replies
CC#
Created by ikalou. on 2/27/2024 in #help
Compression with real time compressed size estimation
I see BouncyCastle has a ZLib implementation that allow querying the total number of bytes so far. I think I'll use that.
3 replies
CC#
Created by ikalou. on 2/27/2024 in #help
Compression with real time compressed size estimation
I want to group small data messages (1-1000 bytes) into message batches while compressing messages within a batch, maximizing the number of messages in a batch but each batch has a hard size limit and I can't go over a single byte. I don't want to have to guess and start over many times.
3 replies
CC#
Created by ikalou. on 2/8/2024 in #help
Casting from int to uint and back
Thanks everyone! Yes I tested it on my machine but I wanted to make sure I could rely on it the result wasn't undefined / an implementation detail.
11 replies