Best practice for viewing population data?
I am working on a .NET application and am experiencing a memory error (I am a Java developer who can do other things), I was thinking about performance. What I am posting was not a memory issue. The memory problem has just begun to think.
I followed a trend in my ASP.NET application that I have used in countless J2EE applications: it is possible to populate dropdowns with Business Entities. The more I think about it, the more I don't like it. For example, in an application I'm working on, we have a dropdown list of current projects. A project is a graph of objects. However, to create the list, we drop all projects, create a graph, and only use the ID and display name. It seems like a terrible waste. To be fair, the dal layer is completely hand-written. A lead architect would not allow an ORM like NHibernate.
I understand that all of these objects are in GEN0 and are garbage collected quickly. My concern is that I am taxing GC. Ever 5% of the CPU needed to handle a GC is 5% of the CPU which I can't use otherwise. This site is one of the few that I really respect. What do you all think? Is it bad to use an entity model for this? Should I create a set of IdValue objects that only have a display value and an ID? Would create such a layer of view objects (I suppose it won't happen in the business layer) just create redundant code?
Thanks JPD
a source to share
I've been working on .NET business applications for the past several years and have yet to run into a performance issue that has been resolved while trying to help the garbage collector run more efficiently.
Metrics assembly on the other hand has been incredibly useful for improving performance, memory usage, etc.
a source to share
Don't worry about taxing the GC, it will tune to your application to give you optimal performance. Yes, it is better to reduce the amount of memory, but I do not think that this is quite a serious problem as you imagine.
A good DAL that allows you to return only the data you need will improve the performance of your application and reduce the amount of memory your application needs. But regardless of whether you are using too much memory or not, I suppose that in most cases the GC will be able to handle it simply.
a source to share