Re: Nhibernate-development Digest, Vol 28, Issue 8
"Jesse Napier" <[email protected]> Thu, 4 Sep 2008 15:17:35 -0700
| Newsgroups | gmane.comp.windows.dotnet.nhibernate.devel |
|---|---|
| Message-ID | <ADDDC70391998C4887386EB544F2600202A4A7E5@gfexchange01.gfhome.gamefly.com> |
This is a multi-part message in MIME format. --===============0689608096== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C90EDC.09467001" This is a multi-part message in MIME format. ------_=_NextPart_001_01C90EDC.09467001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I ran some performance test using the static proxy generator and I didn't see any improvement what so ever after startup. Since castle dynamic proxy caches the proxy this is what I expected. =20 ________________________________ From: [email protected] [mailto:[email protected]] On Behalf Of Ayende Rahien Sent: Thursday, September 04, 2008 4:32 AM To: the NHibernate development list Subject: Re: [NHibernate-development] Nhibernate-development Digest, Vol 28,Issue 8 =20 The Dynamic Proxy implementation is caching types already internally. On Thu, Sep 4, 2008 at 4:33 AM, Andrew Mayorov <[email protected]> wrote: Johan, I agree about ability to make a choice. BTW, we use NH in web environment, so a little bigger delay in startup doesn't matter. For us it's more important to be able to add new types w/o recompilation of all package, so precompiled proxies doesn't seem as good solution. Anyway, I think that stock implementation of proxy generator should be modified in a way you've described - it should cache types. There are very little efforts necessary for this, while bonus is obvious. Best, Andrew > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf > Of Johan Kirsten > Sent: Thursday, September 04, 2008 12:09 PM > To: [email protected] > Subject: Re: [NHibernate-development] Nhibernate-development Digest, > Vol 28, Issue 8 > > Hi Andrew > > Unfortunately the theory is different from the practice. I have > investigated > this matter > (http://groups.google.com/group/nhibernate- > development/browse_thread/thread/90b9e4feca7c3552) > > Basically the problem is that NHibernate compiles the proxy each time > and > every time it needs to instantiate the proxy. i.e for each constructor > call > there is a preceding compilation of the proxy. It does not get cached. > Please refer to the class > NHibernate.Proxy.Poco.Castle.CastleProxyFactory. > > Your options are: > 1) change NHibernate.Proxy.Poco.Castle.CastleProxyFactory to cache its > proxy > type as in the link above > 2) use compile time proxies. > > If option 1 is used, then your theory is correct. I prefer to use > compile > time proxies as I want my users not to have unnecessary delays. The > more I > can move to compile time or start up the better. I tried to move the > compilation of all my run time proxies to startup by altering > NHibernate.Proxy.Poco.Castle.CastleProxyFactory, but that took too long > and > used a lot of memory. I have a complicated system with a lot of types. > Hence > I prefer compile time proxies. Other people might prefer option 1. I > think > people should be given a choice. > > Best regards > > Johan Kirsten > > > ------------------------------ > > > > Message: 2 > > Date: Thu, 4 Sep 2008 11:39:24 +0400 > > From: "Andrew Mayorov" <[email protected]> > > Subject: Re: [NHibernate-development] Speed improvement using compile > > time generated proxies > > To: "'the NHibernate development list'" > > <[email protected]> > > Message-ID: <037101c90e61$5dae9970$190bcc50$@com> > > Content-Type: text/plain; charset=3D"us-ascii" > > > > Hi! > > > > > > > > Guys, can anyone explain why precompiled proxy could be faster than > > runtime > > generated in real application? Proxy generation should be one time > > operation > > for each type, and as soon as we've made a proxy for particular type > there > > should be no difference in method of its creation. Yes, first query > with > > precompiled proxy would execute faster, but all subsequent should > have the > > same speed. > > > > > > > > Best, > > > > Andrew > > > > > > > > ----------------------------------------------------------------------- > -- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/ > _______________________________________________ > Nhibernate-development mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nhibernate-development ------------------------------------------------------------------------ - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/ _______________________________________________ Nhibernate-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nhibernate-development =20 ------_=_NextPart_001_01C90EDC.09467001 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" = xmlns:o=3D"urn:schemas-microsoft-com:office:office" = xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns=3D"http://www.w3.org/TR/REC-html40"> <head> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3Dus-ascii"> <meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman";} a:link, span.MsoHyperlink {color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:blue; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in;} div.Section1 {page:Section1;} --> </style> </head> <body lang=3DEN-US link=3Dblue vlink=3Dblue> <div class=3DSection1> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'>I ran some performance test using = the static proxy generator and I didn’t see any improvement what so ever = after startup. Since castle dynamic proxy caches the proxy this is what I = expected.<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D2 color=3Dnavy face=3DArial><span = style=3D'font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p> <div> <div class=3DMsoNormal align=3Dcenter style=3D'text-align:center'><font = size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'> <hr size=3D2 width=3D"100%" align=3Dcenter tabindex=3D-1> </span></font></div> <p class=3DMsoNormal><b><font size=3D2 face=3DTahoma><span = style=3D'font-size:10.0pt; font-family:Tahoma;font-weight:bold'>From:</span></font></b><font = size=3D2 face=3DTahoma><span style=3D'font-size:10.0pt;font-family:Tahoma'> [email protected] [mailto:[email protected]] <b><span style=3D'font-weight:bold'>On Behalf Of </span></b>Ayende Rahien<br> <b><span style=3D'font-weight:bold'>Sent:</span></b> Thursday, September = 04, 2008 4:32 AM<br> <b><span style=3D'font-weight:bold'>To:</span></b> the NHibernate = development list<br> <b><span style=3D'font-weight:bold'>Subject:</span></b> Re: [NHibernate-development] Nhibernate-development Digest, Vol 28,Issue = 8</span></font><o:p></o:p></p> </div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> <div> <p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><font size=3D3 face=3D"Times New Roman"><span style=3D'font-size:12.0pt'>The Dynamic = Proxy implementation is caching types already = internally.<o:p></o:p></span></font></p> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'>On Thu, Sep 4, 2008 at 4:33 AM, Andrew Mayorov <<a href=3D"mailto:[email protected]">[email protected]</a>> = wrote:<o:p></o:p></span></font></p> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'>Johan,<br> <br> I agree about ability to make a choice. BTW, we use NH in web = environment,<br> so a little bigger delay in startup doesn't matter. For us it's more<br> important to be able to add new types w/o recompilation of all package, = so<br> precompiled proxies doesn't seem as good solution.<br> <br> Anyway, I think that stock implementation of proxy generator should = be<br> modified in a way you've described - it should cache types. There are = very<br> little efforts necessary for this, while bonus is obvious.<br> <br> Best,<br> <font color=3D"#888888"><span = style=3D'color:#888888'>Andrew</span></font><o:p></o:p></span></font></p>= <div> <div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><br> > -----Original Message-----<br> > From: <a = href=3D"mailto:[email protected]">nhib= [email protected]</a><br> > [mailto:<a href=3D"mailto:[email protected]">nhib= [email protected]</a>] On Behalf<br> > Of Johan Kirsten<br> > Sent: Thursday, September 04, 2008 12:09 PM<br> > To: <a = href=3D"mailto:[email protected]">nhibernate-d= [email protected]</a><br> > Subject: Re: [NHibernate-development] Nhibernate-development = Digest,<br> > Vol 28, Issue 8<br> ><br> > Hi Andrew<br> ><br> > Unfortunately the theory is different from the practice. I have<br> > investigated<br> > this matter<br> > (<a href=3D"http://groups.google.com/group/nhibernate-" = target=3D"_blank">http://groups.google.com/group/nhibernate-</a><br> > development/browse_thread/thread/90b9e4feca7c3552)<br> ><br> > Basically the problem is that NHibernate compiles the proxy each = time<br> > and<br> > every time it needs to instantiate the proxy. i.e for each = constructor<br> > call<br> > there is a preceding compilation of the proxy. It does not get = cached.<br> > Please refer to the class<br> > NHibernate.Proxy.Poco.Castle.CastleProxyFactory.<br> ><br> > Your options are:<br> > 1) change NHibernate.Proxy.Poco.Castle.CastleProxyFactory to cache = its<br> > proxy<br> > type as in the link above<br> > 2) use compile time proxies.<br> ><br> > If option 1 is used, then your theory is correct. I prefer to = use<br> > compile<br> > time proxies as I want my users not to have unnecessary delays. = The<br> > more I<br> > can move to compile time or start up the better. I tried to move = the<br> > compilation of all my run time proxies to startup by altering<br> > NHibernate.Proxy.Poco.Castle.CastleProxyFactory, but that took too = long<br> > and<br> > used a lot of memory. I have a complicated system with a lot of = types.<br> > Hence<br> > I prefer compile time proxies. Other people might prefer option 1. = I<br> > think<br> > people should be given a choice.<br> ><br> > Best regards<br> ><br> > Johan Kirsten<br> ><br> > > ------------------------------<br> > ><br> > > Message: 2<br> > > Date: Thu, 4 Sep 2008 11:39:24 +0400<br> > > From: "Andrew Mayorov" <<a href=3D"mailto:[email protected]">[email protected]</a>><br> > > Subject: Re: [NHibernate-development] Speed improvement using = compile<br> > > time generated proxies<br> > > To: "'the NHibernate development list'"<br> > > <<a = href=3D"mailto:[email protected]">nhibernate-d= [email protected]</a>><br> > > Message-ID: <037101c90e61$5dae9970$190bcc50$@com><br> > > Content-Type: text/plain; charset=3D"us-ascii"<br> > ><br> > > Hi!<br> > ><br> > ><br> > ><br> > > Guys, can anyone explain why precompiled proxy could be faster = than<br> > > runtime<br> > > generated in real application? Proxy generation should be one = time<br> > > operation<br> > > for each type, and as soon as we've made a proxy for = particular type<br> > there<br> > > should be no difference in method of its creation. Yes, first = query<br> > with<br> > > precompiled proxy would execute faster, but all subsequent = should<br> > have the<br> > > same speed.<br> > ><br> > ><br> > ><br> > > Best,<br> > ><br> > > Andrew<br> > ><br> > ><br> ><br> ><br> ><br> > = -----------------------------------------------------------------------<b= r> > --<br> > This SF.Net email is sponsored by the Moblin Your Move = Developer's<br> > challenge<br> > Build the coolest Linux based applications with Moblin SDK & = win great<br> > prizes<br> > Grand prize is a trip for two to an Open Source event anywhere in = the<br> > world<br> > <a = href=3D"http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D= /" target=3D"_blank">http://moblin-contest.org/redirect.php?banner_id=3D100&= amp;url=3D/</a><br> > _______________________________________________<br> > Nhibernate-development mailing list<br> > <a = href=3D"mailto:[email protected]">Nhibernate-d= [email protected]</a><br> > <a href=3D"https://lists.sourceforge.net/lists/listinfo/nhibernate-developme= nt" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/nhibernate= -development</a><br> <br> <br> -------------------------------------------------------------------------= <br> This SF.Net email is sponsored by the Moblin Your Move Developer's = challenge<br> Build the coolest Linux based applications with Moblin SDK & win = great prizes<br> Grand prize is a trip for two to an Open Source event anywhere in the = world<br> <a = href=3D"http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D= /" target=3D"_blank">http://moblin-contest.org/redirect.php?banner_id=3D100&= amp;url=3D/</a><br> _______________________________________________<br> Nhibernate-development mailing list<br> <a = href=3D"mailto:[email protected]">Nhibernate-d= [email protected]</a><br> <a = href=3D"https://lists.sourceforge.net/lists/listinfo/nhibernate-developme= nt" target=3D"_blank">https://lists.sourceforge.net/lists/listinfo/nhibernate= -development</a><o:p></o:p></span></font></p> </div> </div> </div> <p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span = style=3D'font-size: 12.0pt'><o:p> </o:p></span></font></p> </div> </div> </body> </html> ------_=_NextPart_001_01C90EDC.09467001-- --===============0689608096== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ --===============0689608096== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Nhibernate-development mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nhibernate-development --===============0689608096==--