castleproject / Core

Castle Core, including Castle DynamicProxy, Logging Services and DictionaryAdapter
http://www.castleproject.org/
Other
2.2k stars 467 forks source link

it's very slow to create proxy #649

Closed coader closed 1 year ago

coader commented 1 year ago

var i = new EntityInterceptor(); var n = new ProxyGenerator().CreateClassProxy<TSource>(i);

it take 8 seconds when execute1000 times in debug mode how to improve it's performance?

stakx commented 1 year ago

Reuse a single ProxyGenerator instance, instead of recreating it in every iteration (as mentioned in our documentation).

coader commented 1 year ago

Reuse a single ProxyGenerator instance, instead of recreating it in every iteration (as mentioned in our documentation).

got it, it works, tks