Friday, 29 January 2016

ASP.NET Tips #76 - Preallocate sizes on things if you can

Many objects like memory stream, list, and dictionary will double their size as needed causing wasteful copying and allocations. If you know your list will have 100,000 items, initialize it as such to avoid problems in the future.

No comments :

Post a comment