No bovine excrement. Really. Nullable is a struct. What that means (idea-wise) is that the bytes that represent the value is on the so-called stack. For Reference types, the value on the stack, is a memory address. What that means…
(Continue Reading →)
If you stored a list of words and wanted to know all the words with a letter ‘a’. Which is data structure is faster? Dictionary<char,List<string>> Hashtable of letters, to list of addresses to words w that letter. Dictionary<char,List<int>> and string[]…
(Continue Reading →)
Compression classes in .NET work very well. Provided, you have to know what data it works well on. You can’t compress something that’s already compressed. If it’s too small, compression has added overhead that can’t overcome by subsequent savings in…
(Continue Reading →)
My undergraduate computer science professor warned me there would be days like this. I paid no heed to his advice because he probably sounded like this paper reads. https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html Survey Why does it matter? Because they have invented something that…
(Continue Reading →)
So why isn’t there a Pop() method for lists. Look for it, finds it, removes it all at once. Instead, we have a .Contains() to make sure it’s there. Then we have a First<>() to get it. Then we have…
(Continue Reading →)
This isn’t a binary tree. No, this is a spaghetti tree, using a Dictionary as its branches. (No, this is not a real data structure. Don’t tell your professor, you’re optimizing spaghetti trees) Is this faster than taking all the…
(Continue Reading →)
Using int comparisons, there is barely any difference between if-else-if or invoking a pre-determined delegate? Options Delegate if-else-if switch 2 1203 1078(-125) 1094(-109) 3 1078 1156(78) 1125(47) 4 1031 1204(173) 1187(156) 5 1141 1218(77) 1188(47) 6 1094 1203(109) 1187(93) Conclusion:…
(Continue Reading →)
You’d think trying save .NET CLR from constantly allocate memory on the heap for a new array would give save you some ticks here or there. Maybe give the garbage collector a break from finding all these thrown away array…
(Continue Reading →)