4 ms·
This data structure abstraction can leak if you're not careful with how your implementation matches the intended usage. I remember ASP.NET used a weird collect
by statictype 16y ago
This data structure abstraction can leak if you're not careful with how your implementation matches the intended usage.
I remember ASP.NET used a weird collection class to store javascript snippets that were to be included in the page being generated. The class internally used an array and then switched to a hashtable once the number of items in the collection went beyond some pre-tuned limit.
As a result, if you tried to register too many javascript blocks to be included on the page, you found that they got included out of order, because the internal storage was now a hashtable with a non-deterministic order for keys.
I spent an entire night debugging this issue.