0xDEAD BEEF
0xDEAD BEEF

Reputation: 2104

Microsoft PolicyInjection Create too slow

Our project is using PolicyInjection (from Microsoft EnterpriseLibrary) for some reason. Problem is, that PolicyInjection.Create(params) takes about 30 ms. This is WAY too much since it is called over 100 times for single request which summs up in unaccapetable performance hit. Is there any solution to this problem? We are using EnterpriseLibary 4.1

Upvotes: 0

Views: 248

Answers (1)

0xDEAD BEEF
0xDEAD BEEF

Reputation: 2104

Ok. So after a lot of investigation I came to conclusion that PolicyInjection simply really is very slow and should never be used in projects! We are going to switch over to PostSharp or simply get rid of PI. PI uses Unity in background for building proxy class. This is incredibly slow process. There are no caches so it is slow slow slow. PI Create can easily take 30 and more miliseconds. Only way to use it is if you are very sure that it won't get called more than few times (but even 30 calls will end up in 1 second).

Upvotes: 0

Related Questions