Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1339
FlatDataSource's DataTableMetadata Performance on Collection Reset
posted

The performance of the DataTableMetadata on initial population is suboptimal (causes our application to hang on the order of seconds to minutes).  Looking at the code, it is simply backed by an array and that array has its capacity increased as necessary.  Unfortunately, the algorithm implemented in the IncereaseCapacity [sic] method simply increases the array size by 1 and copies the array.  This causes extreme memory churn.

I would propose that the array resizing be a little smarter, and perhaps the collection could just be backed by a List to defer the resizing responsibility (unless there was a conscious decision made as to why doubling the array on resize was not desirable).