Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / January 2005

Tip: Looking for answers? Try searching our database.

Properties faster than Fields ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JEB - 20 Jan 2005 19:37 GMT
I was trying to find out the fastest way (coding standards and best practices
aside) to set data into Business Entities which only job is to encasulate
DataTables from the Business Components processing them.  We thought that
Fields would be faster but in a simple test of get/setting data into
properties, it seems they are faster up to a certain point.  

Why is that?  Does anyone know?  Does .NET optimize the code in a particular
way that makes Fields manipulation the same as Properties?

Any help in understanding this is appreciated.

James
Sean Hederman - 20 Jan 2005 20:18 GMT
>I was trying to find out the fastest way (coding standards and best
>practices
[quoted text clipped - 6 lines]
> particular
> way that makes Fields manipulation the same as Properties?

If your properties are simple accessor properties, then the JIT will
optimize the calls away to direct field access.
JEB - 20 Jan 2005 20:37 GMT
Than why would it get slower after a certain number of iterations.  Do you
know where I can find documentation on what the JIT optimizer will do for
Fields vs. Properties?

Thanks for your response, Sean.

James

> >I was trying to find out the fastest way (coding standards and best
> >practices
[quoted text clipped - 9 lines]
> If your properties are simple accessor properties, then the JIT will
> optimize the calls away to direct field access.
Sean Hederman - 20 Jan 2005 21:23 GMT
> Than why would it get slower after a certain number of iterations.  Do you
> know where I can find documentation on what the JIT optimizer will do for
> Fields vs. Properties?

I have no idea why it would slow down, I'm afraid.

Have a look at:
http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&P=R1154
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/d
otnetperftechs.asp

JEB - 20 Jan 2005 22:41 GMT
Thanks, Sean.  This answers my question and gives me some direction to
explain why there is a performance difference.

JEB

> > Than why would it get slower after a certain number of iterations.  Do you
> > know where I can find documentation on what the JIT optimizer will do for
[quoted text clipped - 5 lines]
> http://discuss.develop.com/archives/wa.exe?A2=ind0205A&L=DOTNET&P=R1154
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/d
otnetperftechs.asp

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.