Use of the internal data table


Author
Message
John Frankewicz
John Frankewicz
StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)
Group: Forum Members
Posts: 36, Visits: 65
We are going to have a very large application, with many business objects. Many of the business objects will have a lifetime equivalent to the time the application is running, for efficiency reasons. Also most of the objects will represent  just one record in the database.

Is there a penality to pay, in terms of memory usage, by keeping the Datatable around rather than storing the columns in private variables, wrapped with properties and then getting rid of the datatable?

I guess I am making an assumption about what is going on so correct me if I am wrong Smile

There are so many things in this product and I am impressed, and trying to convince my associates this is the tool to use.

Thanks for all your help

StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
There is a slight memory penalty for using a DataTable with one record, but nothing like using a DataSet. This is the main reason we used a DataTable rather than a DataSet. If you use a DataSet with only one record, you're looking at about 8x the memory usage as a DataTable with only one record.



Realistically, the memory usage penalty is negligable for storing only one record in a DataTable and it's worth it to incur that penalty to be able to store multiple records in the same class that is used to store a single record.



With an O/R mapper, you'd have a slightly smaller memory footprint for each "entity" object, but the entity collections are not as efficient at storing multiple records as a DataTable. The performance and functionality penalties of using the custom collection are far worse than the memory penalty of the DataTable.



Note: This is especially true for .NET 2.0 as the ADO.NET team really improved the indexing performance of a DataTable making it much faster than a custom collection for sorting, filtering, and navigating the records.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search