开发者

DataTable and List object comparison

开发者 https://www.devze.com 2022-12-17 11:33 出处:网络
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

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
0

精彩评论

暂无评论...
验证码 换一张
取 消