Dynamic Proxy performance

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

Dynamic Proxy performance

by Krzysztof Koźmic (2) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Guys,

We're getting close to beta of Dynamic Proxy v2.2, and as it underwent
some heavy internal changes I wanted to run some benchmarks to see if
the perf and memory consumption didn't degrade (much).
I created this simple test: http://gist.github.com/230396 and compiled
it against DP 2.1 and latest build of DP.

Now here are the numbers:

for v2.1 ~9s on my machine
for v2.2 ~3s on my machine!

it is incredible (literally - I can not believe this). I re-ran the test
several times but I keep getting very similar results.
Can anyone of you do the same on your machine and post the results here?
Or please be so kind to point out this stupid mistake I must have made
somewhere along the way.


Krzysztof

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---



begin:vcard
fn;quoted-printable:Krzysztof Ko=C5=BAmic
n;quoted-printable:Ko=C5=BAmic;Krzysztof
email;internet:krzysztof@...
x-mozilla-html:FALSE
version:2.1
end:vcard



Re: Dynamic Proxy performance

by Jonathon Rossi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I can confirm those numbers on my machine for your test.

I tried comparing 2 dotTrace profiling sessions, but things are very very hard to compare as you already know. So I created another 2 very basic tests because it looked like handling attributes was quicker in 2.2.

I created 1000 test interfaces and 1000 test classes as below which where in 2 separate tests.
public interface ITest1 { void Method(string arg); }
public class Test1 { void Method(string arg) { } }

I saw the same performance increase with InterfaceProxyWithoutTarget in 2.2, while ClassProxy was 2x faster in 2.2.

I don't have more time to look into this tonight, but I am interested to know if any specific changes have improved the performance, or it is just all the smaller changes adding up.

The best way for us to get an idea of the performance changes is to get some large real world tests using the 2.2 codebase.

2009/11/10 Krzysztof Koźmic <krzysztof@...>
Guys,

We're getting close to beta of Dynamic Proxy v2.2, and as it underwent
some heavy internal changes I wanted to run some benchmarks to see if
the perf and memory consumption didn't degrade (much).
I created this simple test: http://gist.github.com/230396 and compiled
it against DP 2.1 and latest build of DP.

Now here are the numbers:

for v2.1 ~9s on my machine
for v2.2 ~3s on my machine!

it is incredible (literally - I can not believe this). I re-ran the test
several times but I keep getting very similar results.
Can anyone of you do the same on your machine and post the results here?
Or please be so kind to point out this stupid mistake I must have made
somewhere along the way.


Krzysztof

--~--~---------~--~----~------------~-------~--~----~
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%2Bunsubscribe@...
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=en
-~----------~----~----~----~------~----~------~--~---




--
Jono

--

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@....
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=.

Re: Dynamic Proxy performance

by Krzysztof Koźmic (2) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good idea,

I'll talk to NHibernate guys, if they have some large set of tests
using DP.

On 10 Lis, 14:21, Jonathon Rossi <j...@...> wrote:

> I can confirm those numbers on my machine for your test.
>
> I tried comparing 2 dotTrace profiling sessions, but things are very very
> hard to compare as you already know. So I created another 2 very basic tests
> because it looked like handling attributes was quicker in 2.2.
>
> I created 1000 test interfaces and 1000 test classes as below which where in
> 2 separate tests.
> public interface ITest1 { void Method(string arg); }
> public class Test1 { void Method(string arg) { } }
>
> I saw the same performance increase with InterfaceProxyWithoutTarget in 2.2,
> while ClassProxy was 2x faster in 2.2.
>
> I don't have more time to look into this tonight, but I am interested to
> know if any specific changes have improved the performance, or it is just
> all the smaller changes adding up.
>
> The best way for us to get an idea of the performance changes is to get some
> large real world tests using the 2.2 codebase.
>
> 2009/11/10 Krzysztof Koźmic <krzysz...@...>
>
>
>
> > Guys,
>
> > We're getting close to beta of Dynamic Proxy v2.2, and as it underwent
> > some heavy internal changes I wanted to run some benchmarks to see if
> > the perf and memory consumption didn't degrade (much).
> > I created this simple test:http://gist.github.com/230396and compiled
> > it against DP 2.1 and latest build of DP.
>
> > Now here are the numbers:
>
> > for v2.1 ~9s on my machine
> > for v2.2 ~3s on my machine!
>
> > it is incredible (literally - I can not believe this). I re-ran the test
> > several times but I keep getting very similar results.
> > Can anyone of you do the same on your machine and post the results here?
> > Or please be so kind to point out this stupid mistake I must have made
> > somewhere along the way.
>
> > Krzysztof
>
> > --~--~---------~--~----~------------~-------~--~----~
> > 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@...<castle-project-devel%2Bunsubscribe@...>
> > For more options, visit this group at
> >http://groups.google.com/group/castle-project-devel?hl=en
> > -~----------~----~----~----~------~----~------~--~---
>
> --
> Jono

--

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@....
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=.



Re: Dynamic Proxy performance

by Krzysztof Koźmic (2) :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I ran Rhino.Mock's tests on the trunk version of DP.
RM uses version a little bit newer than v2.1, but before the
restructuring, so I suppose the numbers would be identical for v2.1
(sans test that would fail under 2.1)

Anyway:

on the version that RM uses out of the box all the tests took - 11.65s
to run (according to xUnit/PSake)
on v2.2 all the tests took - 10.80s to run (according to xUnit/PSake)

Notice that not all RM tests use DP. Also DP uses proxy assembly per
mocked type, to mitigate performance hit that DP gets from SRE when we
generate lots of types into single assembly.

Anyway, the performance gain is noticable.

Krzysztof

On 10 Lis, 14:24, Krzysztof Koźmic (2) <krzysz...@...> wrote:

> Good idea,
>
> I'll talk to NHibernate guys, if they have some large set of tests
> using DP.
>
> On 10 Lis, 14:21, Jonathon Rossi <j...@...> wrote:
>
> > I can confirm those numbers on my machine for your test.
>
> > I tried comparing 2 dotTrace profiling sessions, but things are very very
> > hard to compare as you already know. So I created another 2 very basic tests
> > because it looked like handling attributes was quicker in 2.2.
>
> > I created 1000 test interfaces and 1000 test classes as below which where in
> > 2 separate tests.
> > public interface ITest1 { void Method(string arg); }
> > public class Test1 { void Method(string arg) { } }
>
> > I saw the same performance increase with InterfaceProxyWithoutTarget in 2.2,
> > while ClassProxy was 2x faster in 2.2.
>
> > I don't have more time to look into this tonight, but I am interested to
> > know if any specific changes have improved the performance, or it is just
> > all the smaller changes adding up.
>
> > The best way for us to get an idea of the performance changes is to get some
> > large real world tests using the 2.2 codebase.
>
> > 2009/11/10 Krzysztof Ko 1/4 mic <krzysz...@...>
>
> > > Guys,
>
> > > We're getting close to beta of Dynamic Proxy v2.2, and as it underwent
> > > some heavy internal changes I wanted to run some benchmarks to see if
> > > the perf and memory consumption didn't degrade (much).
> > > I created this simple test:http://gist.github.com/230396andcompiled
> > > it against DP 2.1 and latest build of DP.
>
> > > Now here are the numbers:
>
> > > for v2.1 ~9s on my machine
> > > for v2.2 ~3s on my machine!
>
> > > it is incredible (literally - I can not believe this). I re-ran the test
> > > several times but I keep getting very similar results.
> > > Can anyone of you do the same on your machine and post the results here?
> > > Or please be so kind to point out this stupid mistake I must have made
> > > somewhere along the way.
>
> > > Krzysztof
>
> > > --~--~---------~--~----~------------~-------~--~----~
> > > 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@...<castle-project-devel%2Bunsubscribe@...>
> > > For more options, visit this group at
> > >http://groups.google.com/group/castle-project-devel?hl=en
> > > -~----------~----~----~----~------~----~------~--~---
>
> > --
> > Jono
>
>

--

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@....
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=.



Re: Dynamic Proxy performance

by Krzysztof Koźmic :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I did some poking around with DotTrace
Out of total saving of 6.5 seconds, we save 2.5 second by not emitting pdbs.



Krzysztof Koźmic (2) wrote:

> I ran Rhino.Mock's tests on the trunk version of DP.
> RM uses version a little bit newer than v2.1, but before the
> restructuring, so I suppose the numbers would be identical for v2.1
> (sans test that would fail under 2.1)
>
> Anyway:
>
> on the version that RM uses out of the box all the tests took - 11.65s
> to run (according to xUnit/PSake)
> on v2.2 all the tests took - 10.80s to run (according to xUnit/PSake)
>
> Notice that not all RM tests use DP. Also DP uses proxy assembly per
> mocked type, to mitigate performance hit that DP gets from SRE when we
> generate lots of types into single assembly.
>
> Anyway, the performance gain is noticable.
>
> Krzysztof
>
> On 10 Lis, 14:24, Krzysztof Koźmic (2) <krzysz...@...> wrote:
>  
>> Good idea,
>>
>> I'll talk to NHibernate guys, if they have some large set of tests
>> using DP.
>>
>> On 10 Lis, 14:21, Jonathon Rossi <j...@...> wrote:
>>
>>    
>>> I can confirm those numbers on my machine for your test.
>>>      
>>> I tried comparing 2 dotTrace profiling sessions, but things are very very
>>> hard to compare as you already know. So I created another 2 very basic tests
>>> because it looked like handling attributes was quicker in 2.2.
>>>      
>>> I created 1000 test interfaces and 1000 test classes as below which where in
>>> 2 separate tests.
>>> public interface ITest1 { void Method(string arg); }
>>> public class Test1 { void Method(string arg) { } }
>>>      
>>> I saw the same performance increase with InterfaceProxyWithoutTarget in 2.2,
>>> while ClassProxy was 2x faster in 2.2.
>>>      
>>> I don't have more time to look into this tonight, but I am interested to
>>> know if any specific changes have improved the performance, or it is just
>>> all the smaller changes adding up.
>>>      
>>> The best way for us to get an idea of the performance changes is to get some
>>> large real world tests using the 2.2 codebase.
>>>      
>>> 2009/11/10 Krzysztof Ko 1/4 mic <krzysz...@...>
>>>      
>>>> Guys,
>>>>        
>>>> We're getting close to beta of Dynamic Proxy v2.2, and as it underwent
>>>> some heavy internal changes I wanted to run some benchmarks to see if
>>>> the perf and memory consumption didn't degrade (much).
>>>> I created this simple test:http://gist.github.com/230396andcompiled
>>>> it against DP 2.1 and latest build of DP.
>>>>        
>>>> Now here are the numbers:
>>>>        
>>>> for v2.1 ~9s on my machine
>>>> for v2.2 ~3s on my machine!
>>>>        
>>>> it is incredible (literally - I can not believe this). I re-ran the test
>>>> several times but I keep getting very similar results.
>>>> Can anyone of you do the same on your machine and post the results here?
>>>> Or please be so kind to point out this stupid mistake I must have made
>>>> somewhere along the way.
>>>>        
>>>> Krzysztof
>>>>        
>>>> --~--~---------~--~----~------------~-------~--~----~
>>>> 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@...<castle-project-devel%2Bunsubscribe@...>
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/castle-project-devel?hl=en
>>>> -~----------~----~----~----~------~----~------~--~---
>>>>        
>>> --
>>> Jono
>>>      
>>    
>
> --
>
> 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@....
> For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=.
>
>
>  

--

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@....
For more options, visit this group at http://groups.google.com/group/castle-project-devel?hl=.