Validator Component Boost

View: New views
13 Messages — Rating Filter:   Alert me  

Validator Component Boost

by Craig Neuwirt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I recently started working on a very data intensive app with AR and validators.  I haven't performed any comprehensive performance analysis, but I know the use of reflection in the validator component could be improved by using DyanmicMethods.  This type of change has been done many time so no bleeding edge or exciting work here.    I attached a patch if anyone wants to provided feedback on the changes.  Using DymaicMethod definitely has a very positive performance boost.  Another benefit of the implementation is that any validators that need to reference other properties of field can be any level deep (not just properties or fields at the root).

To avoid a breaking change, I use some extension interfaces to denote validators who support this.  This can be rolled into the core abstract classes if desired.

craig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---



Validator.patch (68K) Download Attachment

Re: Validator Component Boost

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Any benchmarks you can share?

On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:

> I recently started working on a very data intensive app with AR and
> validators.  I haven't performed any comprehensive performance analysis, but
> I know the use of reflection in the validator component could be improved by
> using DyanmicMethods.  This type of change has been done many time so no
> bleeding edge or exciting work here.    I attached a patch if anyone wants
> to provided feedback on the changes.  Using DymaicMethod definitely has a
> very positive performance boost.  Another benefit of the implementation is
> that any validators that need to reference other properties of field can be
> any level deep (not just properties or fields at the root).
>
> To avoid a breaking change, I use some extension interfaces to denote
> validators who support this.  This can be rolled into the core abstract
> classes if desired.
>
> craig
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Craig Neuwirt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I plan on doing more extensive tests, but I just took the ValidatorRunnerTest case for Person and performed the validation a 100,000 - 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is typical of the reported important when using DynamicMethods instead of propertyInfo.GetValue.  Of course actual times depend on number of validators.  The cross property/field validations will show even more improvements depending on reference levels.


On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo <hammett@...> wrote:

Any benchmarks you can share?

On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I recently started working on a very data intensive app with AR and
> validators.  I haven't performed any comprehensive performance analysis, but
> I know the use of reflection in the validator component could be improved by
> using DyanmicMethods.  This type of change has been done many time so no
> bleeding edge or exciting work here.    I attached a patch if anyone wants
> to provided feedback on the changes.  Using DymaicMethod definitely has a
> very positive performance boost.  Another benefit of the implementation is
> that any validators that need to reference other properties of field can be
> any level deep (not just properties or fields at the root).
>
> To avoid a breaking change, I use some extension interfaces to denote
> validators who support this.  This can be rolled into the core abstract
> classes if desired.
>
> craig
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Hamilton Verissimo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:

> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Gauthier Segay :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Not sure for 2.0, but Phil Haack has some explanation about medium
trust in 3.5 allowing il emit:

http://tech.groups.yahoo.com/group/altdotnet/message/11671

On Jul 13, 12:12 am, "Hamilton Verissimo"
<hamm...@...> wrote:

> cool, does that impose any restriction for medium trust environments?
>
>
>
> On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuw...@...> wrote:
> > I plan on doing more extensive tests, but I just took the
> > ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> > 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> > typical of the reported important when using DynamicMethods instead of
> > propertyInfo.GetValue.  Of course actual times depend on number of
> > validators.  The cross property/field validations will show even more
> > improvements depending on reference levels.
>
> > On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> > <hamm...@...> wrote:
>
> >> Any benchmarks you can share?
>
> >> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuw...@...> wrote:
> >> > I recently started working on a very data intensive app with AR and
> >> > validators.  I haven't performed any comprehensive performance analysis,
> >> > but
> >> > I know the use of reflection in the validator component could be
> >> > improved by
> >> > using DyanmicMethods.  This type of change has been done many time so no
> >> > bleeding edge or exciting work here.    I attached a patch if anyone
> >> > wants
> >> > to provided feedback on the changes.  Using DymaicMethod definitely has
> >> > a
> >> > very positive performance boost.  Another benefit of the implementation
> >> > is
> >> > that any validators that need to reference other properties of field can
> >> > be
> >> > any level deep (not just properties or fields at the root).
>
> >> > To avoid a breaking change, I use some extension interfaces to denote
> >> > validators who support this.  This can be rolled into the core abstract
> >> > classes if desired.
>
> >> > craig
>
> >> --
> >> Cheers,
> >> hamilton verissimo
> >> hamm...@...
> >>http://www.castlestronghold.com/
>
> --
> Cheers,
> hamilton verissimo
> hamm...@...://www.castlestronghold.com/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Craig Neuwirt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yeah, reflection emit could be a problem.  Gotta look into that.

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Craig Neuwirt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Ken Egozi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

btw, it should also work on 2.0sp1, but we don't have a conditional or a specialised build for that.

On Fri, Jul 18, 2008 at 3:47 PM, Craig Neuwirt <cneuwirt@...> wrote:
It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/








--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.mamaherb.com
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Roelof Blom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I would like a check at runtime to determine the framework version and patchlevel better.

On Fri, Jul 18, 2008 at 2:49 PM, Ken Egozi <egozi13@...> wrote:
btw, it should also work on 2.0sp1, but we don't have a conditional or a specialised build for that.


On Fri, Jul 18, 2008 at 3:47 PM, Craig Neuwirt <cneuwirt@...> wrote:
It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/








--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.mamaherb.com
http://www.gotfriends.co.il




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Craig Neuwirt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Cool, good to know. 

I wish there was an easy way to check if a permission (ReflectionEmit in this case) is available without performing a demand and catching an exception.  Do you know of any other way?

On Fri, Jul 18, 2008 at 7:49 AM, Ken Egozi <egozi13@...> wrote:
btw, it should also work on 2.0sp1, but we don't have a conditional or a specialised build for that.


On Fri, Jul 18, 2008 at 3:47 PM, Craig Neuwirt <cneuwirt@...> wrote:
It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/








--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.mamaherb.com
http://www.gotfriends.co.il




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Ken Egozi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

can do this once and store in a static bool.

On Fri, Jul 18, 2008 at 3:55 PM, Craig Neuwirt <cneuwirt@...> wrote:
Cool, good to know. 

I wish there was an easy way to check if a permission (ReflectionEmit in this case) is available without performing a demand and catching an exception.  Do you know of any other way?

On Fri, Jul 18, 2008 at 7:49 AM, Ken Egozi <egozi13@...> wrote:
btw, it should also work on 2.0sp1, but we don't have a conditional or a specialised build for that.


On Fri, Jul 18, 2008 at 3:47 PM, Craig Neuwirt <cneuwirt@...> wrote:
It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/








--








--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.mamaherb.com
http://www.gotfriends.co.il

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Roelof Blom :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

DefaultComponentActivator does it differently, see it's ctor.

On Fri, Jul 18, 2008 at 2:57 PM, Ken Egozi <egozi13@...> wrote:
can do this once and store in a static bool.


On Fri, Jul 18, 2008 at 3:55 PM, Craig Neuwirt <cneuwirt@...> wrote:
Cool, good to know. 

I wish there was an easy way to check if a permission (ReflectionEmit in this case) is available without performing a demand and catching an exception.  Do you know of any other way?

On Fri, Jul 18, 2008 at 7:49 AM, Ken Egozi <egozi13@...> wrote:
btw, it should also work on 2.0sp1, but we don't have a conditional or a specialised build for that.


On Fri, Jul 18, 2008 at 3:47 PM, Craig Neuwirt <cneuwirt@...> wrote:
It should work in 3.5 medium, not 2.0.  If I put a conditional around the piece that creates the dynamic method, should I commit this?

On Sat, Jul 12, 2008 at 5:12 PM, Hamilton Verissimo <hammett@...> wrote:

cool, does that impose any restriction for medium trust environments?

On Sat, Jul 12, 2008 at 6:26 PM, Craig Neuwirt <cneuwirt@...> wrote:
> I plan on doing more extensive tests, but I just took the
> ValidatorRunnerTest case for Person and performed the validation a 100,000 -
> 1,000,000 times and saw times of 1-2 seconds become .04 seconds.  This is
> typical of the reported important when using DynamicMethods instead of
> propertyInfo.GetValue.  Of course actual times depend on number of
> validators.  The cross property/field validations will show even more
> improvements depending on reference levels.
>
>
> On Sat, Jul 12, 2008 at 4:16 PM, Hamilton Verissimo
> <hammett@...> wrote:
>>
>> Any benchmarks you can share?
>>
>> On Sat, Jul 12, 2008 at 5:27 PM, Craig Neuwirt <cneuwirt@...> wrote:
>> > I recently started working on a very data intensive app with AR and
>> > validators.  I haven't performed any comprehensive performance analysis,
>> > but
>> > I know the use of reflection in the validator component could be
>> > improved by
>> > using DyanmicMethods.  This type of change has been done many time so no
>> > bleeding edge or exciting work here.    I attached a patch if anyone
>> > wants
>> > to provided feedback on the changes.  Using DymaicMethod definitely has
>> > a
>> > very positive performance boost.  Another benefit of the implementation
>> > is
>> > that any validators that need to reference other properties of field can
>> > be
>> > any level deep (not just properties or fields at the root).
>> >
>> > To avoid a breaking change, I use some extension interfaces to denote
>> > validators who support this.  This can be rolled into the core abstract
>> > classes if desired.
>> >
>> > craig
>> >
>> > >
>> >
>>
>>
>>
>> --
>> Cheers,
>> hamilton verissimo
>> hammett@...
>> http://www.castlestronghold.com/
>>
>>
>
>
> >
>



--
Cheers,
hamilton verissimo
hammett@...
http://www.castlestronghold.com/








--








--
Ken Egozi.
http://www.kenegozi.com/blog
http://www.musicglue.com
http://www.castleproject.org
http://www.mamaherb.com
http://www.gotfriends.co.il




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Castle Project Development List" group.
To post to this group, send email to castle-project-devel@...
To unsubscribe from this group, send email to castle-project-devel-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Validator Component Boost

by Craig Neuwirt :: Rate this Message: