Thanks again for your reply. The reason for the question is because i found this article about the performance and it wasnt clear to me which approach Nhibernate uses as default
http://jaychapman.blogspot.com/2007/11/nhibernate-access-performance.html http://jaychapman.blogspot.com/2007/12/datetimenow-precision-issues-enter.html (last one is with updated results after using StopWatch class). It shows that basic reflection access to both public properties and private fields are slow (but private fields 2 times slower than properties). The lightweight approach is really quick no matter if private field or public properties. The codedom approach is quick when using public properties but slow when using private fields. I tried downloading the code and use it with latest version of Nhibernate from Trunk and .Net 4.0 The results was opposite to the ones in the article. Basic reflection access to private fields is about 3-4 times faster than using a public property (both for get and set). The lightweight approach is still super fast and only takes 2-3 times longer than direct field or property access. I wasnt able to make the CodeDom approach work. I am unsure which approach the ReflectionOptimizer option is using (lightweight or codedom or maybe changed to something different), and if it makes any difference if i use properties with public getter and private setter or change to using private backing fields (according to my own tests using the lightweight approach there were no difference). No matter what, if the speed i can count on when ReflectionOptimizer is enabled is like the lightweight approach there is aboslutly nothing to worry about :) Thanks (for the answer and all the work you have put into NHibernate). Martin :) ps. i can see the difference with my eyes when looking at the numbers on the screen :) On 22 Jul., 07:05, Fabio Maulo <[email protected]> wrote: > eh ? > > btw... around 3 years ago we made a performance test where we found that the > access to field has better performance than access to property when we use > the reflection optimizer, but if you can see (with your eyes) the difference > after one million of accesses we will send you a gift. > > P.S. the gift will be a NH's issue fixed for free. > > > > > > On Wed, Jul 21, 2010 at 10:52 PM, MartinF <[email protected]> wrote: > > Thanks :) > > > Btw, is it better to map properties with a public setter rather than > > protected or private when it comes to performance ? is it required to > > be able to use the ReflectionOptimizer option ? > > > On 17 Jul., 18:44, Fabio Maulo <[email protected]> wrote: > > > The name of the extension method is : Fetch > > > > On Sat, Jul 17, 2010 at 1:25 PM, MartinF <[email protected]> wrote: > > > > Hello, > > > > > i am just wondering if there will be an Expand method available to use > > > > with the new linq provider, to make it possible to eagerload > > > > relations ? > > > > > I read a comment by Steve Strong from about 5 months ago that he was > > > > working on it already and hoped to have something out really soon. > > > >http://blogs.imeta.co.uk/sstrong/archive/2009/12/16/824.aspx#5624 > > > > > But havent heard anything about it since. > > > > > Martin > > > > > -- > > > > You received this message because you are subscribed to the Google > > Groups > > > > "nhusers" group. > > > > To post to this group, send email to [email protected]. > > > > To unsubscribe from this group, send email to > > > > [email protected]<nhusers%[email protected]> > > <nhusers%[email protected]<nhusers%252bunsubscr...@googlegroups.com> > > > > > > > . > > > > For more options, visit this group at > > > >http://groups.google.com/group/nhusers?hl=en. > > > > -- > > > Fabio Maulo- Skjul tekst i anførselstegn - > > > > - Vis tekst i anførselstegn - > > > -- > > You received this message because you are subscribed to the Google Groups > > "nhusers" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<nhusers%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/nhusers?hl=en. > > -- > Fabio Maulo- Skjul tekst i anførselstegn - > > - Vis tekst i anførselstegn - -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
