i m a part of an ERP solution team and want to measure the performance in terms of development. By a simple process a DataTable is populated from database with 10000 odd rec开发者_如何学Pythonords and on other hand a List object is filled with the same records.
my question is, which one is the lightweight and performance measurable object and why.
The answer to this question says that a List<MyObject>
can be cheaper than a DataTable
when primitive/value (unboxed) data types are used:
- List using more memory than DataTable?
The answer to this question says that creating a List<MyObject>
is even cheaper if you know the count when you create the List
.
i.e. List<MyObject> myObjects = new List<MyObject>(10);
- DataTable to List
精彩评论