The biggest news is that this version of the module is fast because I can use dynamic arrays in structs now. The current limitations on managed structs led me to some suboptimal code when working with String
s, but I can pretty consistently push one million int
s (the current max size for a dynamic array btw) into a Stack
in a single for
loop in only about 30 seconds! By way of comparison, with v1.3 I tried pushing a measly ten thousand int
s into a Stack
and the program froze for more than half an hour before I force-closed it with Task Manager. I can push ten thousand int
s with this version in under a second.
To really optimize the speed, I made it possible to set the capacity of a Stack
(setting the size of the underlying dynamic array) and avoid additional copying. Considering how much unnecessary copying was taking place in v1.3 of this module, anyone who actually used the older module should be quite happy with the improvements I've made.