Mohan, great questions! Here are some pointers and articles I've found useful.
The general answer about class size, static methods, public methods and application performance is that none of this really matters for all but the most intense applications. The second general rule of thumb is that if you aren't sure that these things are causing your performance issue then start looking somewhere else. For instance, if you are doing DB work and one call to the DB takes 100ms while loading your class with 1,000 public methods takes 5 ms vs 3ms(if you did it with fewer methods) you can see that there isn't much to gain. While these numbers aren't necessarily real #'s they are I think close to the level of scale you'll see. In general class size, # of statics, and # of publics really isnt' going to noticeably affect things. If on the other hand you are just curious and want to better understand how it all works then here are some articles to get you started. For some of your questions there aren't a lot of great resources out there. At TechEd 2003 the CLR team (I think it was them) did a presentation with lots of micro benchmarks. I don't have the pres here but you might be able to find it out there, especially if you know someone who went last year. Incredible .Net performance article from MS. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/scalenet.asp How-To on Microbenchmarking http://www.yoda.arachsys.com/csharp/benchmark.html Regarding your DAL, you could pass your data in a lighterweight strucutre like an array or a RowCollection, or even a DataTable. Like above though you probably won't see any real difference except in the most extreme circumstances. Greg Ewing [MVP] www.citidc.com Original Message: >From: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: [AspNetAnyQuestionIsOk] Big Vs Small Classes Performance >Date: Wed, 19 May 2004 17:25:38 +0800 >Hi All, > >1) Is this true:- More methods (i mean public) and variables in classes >will make the application slower when instances are created? >How to design methods in classes? How many methods can we normally have in >classes for performance reasons? I read somewhere that classes must not be >too big or too small. > >Can we find out how the classes are performing, faster or slower? > >What if I make the methods as static(C#) so that I don't create any >instance of the Classes at all? >(These methods can also be database access methods) > >2) I have Data Access Layer(DAL) classes and I am passing DataSet as >arguments. What are the other ways of passing Rows of records to DAL, so >that the processing will be faster? > >Can anybody help me to understand this? > >thanks in advance for the OOPS gurus! >Mohan > >Disclaimer: >The contents of this e-mail are strictly confidential and may be >privileged. It represents solely the views of the author and is meant only >for the stated recipient/s. >Any unauthorized distribution is strictly prohibited. F J Benjamin Group >or its subsidiaries will not accept responsibility for any damage caused by >this e-mail or >attachment/s (if any), which have been checked for viruses. > >Please visit our website http://www.fjbenjamin.com > > > > > >Yahoo! Groups Links > > > > > > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
