Created
November 9, 2009 22:49
-
-
Save kkozmic/230396 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace DP_perf_1 | |
{ | |
using System.Diagnostics; | |
using Castle.DynamicProxy; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var generator = new ProxyGenerator(); | |
int i = 0; | |
var sw = Stopwatch.StartNew(); | |
foreach (var type in typeof(object).Assembly.GetTypes().Union(typeof(Uri).Assembly.GetTypes()).Where(t => t.IsVisible && t.IsInterface && !t.IsGenericTypeDefinition)) | |
{ | |
var target = generator.CreateInterfaceProxyWithoutTarget(type); | |
i++; | |
target.GetType(); | |
} | |
sw.Stop(); | |
Console.WriteLine(i); // 256 | |
Console.WriteLine(sw.Elapsed); | |
Console.ReadKey(true); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment