Index: src/Castle.Components.DictionaryAdapter/DictionaryAdapterFactory.cs
===================================================================
--- src/Castle.Components.DictionaryAdapter/DictionaryAdapterFactory.cs	(revision 6729)
+++ src/Castle.Components.DictionaryAdapter/DictionaryAdapterFactory.cs	(working copy)
@@ -58,7 +58,7 @@
 		/// </remarks>
 		public T GetAdapter<T>(IDictionary dictionary)
 		{
-			return (T) GetAdapter(typeof(T), dictionary);
+			return (T)GetAdapter(typeof(T), dictionary);
 		}
 
 		/// <summary>
@@ -122,24 +122,37 @@
 
 		#region Dynamic Type Generation
 
+		readonly Dictionary<Type, Type> _interfaceToAdapter = new Dictionary<Type, Type>();
+		readonly object _typesDictionaryLocker = new object();
 		private object InternalGetAdapter(Type type, IDictionary dictionary, PropertyDescriptor descriptor)
 		{
 			if (!type.IsInterface)
 			{
 				throw new ArgumentException("Only interfaces can be adapted");
 			}
+			Type adapterType;
+			if (_interfaceToAdapter.TryGetValue(type, out adapterType) == false)
+			{
+				lock (_typesDictionaryLocker)
+				{
+					if (_interfaceToAdapter.TryGetValue(type, out adapterType) == false)
+					{
+						var appDomain = Thread.GetDomain();
+						var adapterAssemblyName = GetAdapterAssemblyName(type);
+						var adapterAssembly = GetExistingAdapterAssembly(appDomain, adapterAssemblyName);
 
-			var appDomain = Thread.GetDomain();
-			var adapterAssemblyName = GetAdapterAssemblyName(type);
-			var adapterAssembly = GetExistingAdapterAssembly(appDomain, adapterAssemblyName);
+						if (adapterAssembly == null)
+						{
+							var typeBuilder = CreateTypeBuilder(type, appDomain, adapterAssemblyName);
+							adapterAssembly = CreateAdapterAssembly(type, typeBuilder, descriptor);
+						}
 
-			if (adapterAssembly == null)
-			{
-				var typeBuilder = CreateTypeBuilder(type, appDomain, adapterAssemblyName);
-				adapterAssembly = CreateAdapterAssembly(type, typeBuilder, descriptor);
+						adapterType = GetExistingAdapter(type, adapterAssembly, dictionary, descriptor);
+						_interfaceToAdapter[type] = adapterType;
+					}
+				}
 			}
-
-			return GetExistingAdapter(type, adapterAssembly, dictionary, descriptor);
+			return CreateAdapterInstance(dictionary, descriptor, adapterType);
 		}
 
 		private static TypeBuilder CreateTypeBuilder(Type type, AppDomain appDomain, String adapterAssemblyName)
@@ -199,8 +212,8 @@
 		private static void CreateAdapterConstructor(Type type, TypeBuilder typeBuilder)
 		{
 			var constructorBuilder = typeBuilder.DefineConstructor(
-				MethodAttributes.Public | MethodAttributes.HideBySig, CallingConventions.Standard, 
-				new [] { typeof(DictionaryAdapterInstance) }
+				MethodAttributes.Public | MethodAttributes.HideBySig, CallingConventions.Standard,
+				new[] { typeof(DictionaryAdapterInstance) }
 				);
 
 			var ilGenerator = constructorBuilder.GetILGenerator();
@@ -220,12 +233,12 @@
 
 		private static void CreateMetaProperty(TypeBuilder typeBuilder, PropertyInfo prop, FieldInfo field)
 		{
-			var propAttribs = MethodAttributes.Public    | MethodAttributes.SpecialName |
+			var propAttribs = MethodAttributes.Public | MethodAttributes.SpecialName |
 							  MethodAttributes.HideBySig | MethodAttributes.ReuseSlot |
-							  MethodAttributes.Virtual   | MethodAttributes.Final;
+							  MethodAttributes.Virtual | MethodAttributes.Final;
 
 			var getMethodBuilder = typeBuilder.DefineMethod("get_" + prop.Name,
-														    propAttribs, prop.PropertyType, null);
+															propAttribs, prop.PropertyType, null);
 
 			var getILGenerator = getMethodBuilder.GetILGenerator();
 			if (field.IsStatic)
@@ -279,7 +292,7 @@
 
 		#region CreatePropertyGetMethod
 
-		private static void CreatePropertyGetMethod(TypeBuilder typeBuilder, PropertyBuilder propertyBuilder, 
+		private static void CreatePropertyGetMethod(TypeBuilder typeBuilder, PropertyBuilder propertyBuilder,
 			PropertyDescriptor descriptor, MethodAttributes propAttribs)
 		{
 			var getMethodBuilder = typeBuilder.DefineMethod(
@@ -334,7 +347,7 @@
 			PropertyDescriptor descriptor, MethodAttributes propAttribs)
 		{
 			var setMethodBuilder = typeBuilder.DefineMethod(
-				"set_" + descriptor.PropertyName, propAttribs, null, new[] {descriptor.PropertyType});
+				"set_" + descriptor.PropertyName, propAttribs, null, new[] { descriptor.PropertyType });
 
 			var setILGenerator = setMethodBuilder.GetILGenerator();
 			PreparePropertyMethod(descriptor, setILGenerator);
@@ -362,7 +375,7 @@
 		#region Property Descriptors
 
 		private static Dictionary<String, PropertyDescriptor> GetPropertyDescriptors(
-			Type type, PropertyDescriptor descriptor, out IDictionaryInitializer[] typeInitializers, 
+			Type type, PropertyDescriptor descriptor, out IDictionaryInitializer[] typeInitializers,
 			out object[] typeBehaviors)
 		{
 			var propertyMap = new Dictionary<String, PropertyDescriptor>();
@@ -392,7 +405,7 @@
 				var descriptorInitializers = GetOrderedBehaviors<IPropertyDescriptorInitializer>(propertyBehaviors);
 				foreach (var descriptorInitializer in descriptorInitializers)
 				{
-					descriptorInitializer.Initialize(propertyDescriptor, propertyBehaviors);	
+					descriptorInitializer.Initialize(propertyDescriptor, propertyBehaviors);
 				}
 
 				propertyDescriptor.AddKeyBuilders(GetOrderedBehaviors<IDictionaryKeyBuilder>(propertyBehaviors));
@@ -422,7 +435,7 @@
 						return;
 					}
 				}
-	
+
 				propertyMap.Add(property.Name, propertyDescriptor);
 			});
 
@@ -439,7 +452,7 @@
 			return AttributesUtil.GetAttributes<T>(member);
 		}
 
-		private static IEnumerable<T> GetOrderedBehaviors<T>(IEnumerable<object> behaviors) 
+		private static IEnumerable<T> GetOrderedBehaviors<T>(IEnumerable<object> behaviors)
 			where T : IDictionaryBehavior
 		{
 			return behaviors.OfType<T>().OrderBy(b => b.ExecutionOrder);
@@ -481,12 +494,12 @@
 
 		#endregion
 
-		#region Assembly Support 
+		#region Assembly Support
 
 		private string GetAdapterAssemblyName(Type type)
 		{
-			return string.Concat(GetAssemblyName( type.Assembly ), ".",
-				GetSafeTypeFullName(type), ".DictionaryAdapter" );
+			return string.Concat(GetAssemblyName(type.Assembly), ".",
+				GetSafeTypeFullName(type), ".DictionaryAdapter");
 		}
 
 		private string GetAssemblyName(Assembly assembly)
@@ -562,17 +575,23 @@
 			}
 		}
 
-		private object GetExistingAdapter(Type type, Assembly assembly, IDictionary dictionary,
+		private Type GetExistingAdapter(Type type, Assembly assembly, IDictionary dictionary,
 										  PropertyDescriptor descriptor)
 		{
 			var adapterFullTypeName = GetAdapterFullTypeName(type);
+			var adapterType = assembly.GetType(adapterFullTypeName, true);
+			return adapterType;
+		}
+
+		private object CreateAdapterInstance(IDictionary dictionary, PropertyDescriptor descriptor, Type adapterType)
+		{
 			var instance = new DictionaryAdapterInstance(dictionary, descriptor, this);
-			return Activator.CreateInstance(assembly.GetType(adapterFullTypeName, true), instance);
+			return Activator.CreateInstance(adapterType, instance);
 		}
 
 		private Assembly GetExistingAdapterAssembly(AppDomain appDomain, string assemblyName)
 		{
-			return Array.Find(appDomain.GetAssemblies(), assembly => GetAssemblyName(assembly) == assemblyName );
+			return Array.Find(appDomain.GetAssemblies(), assembly => GetAssemblyName(assembly) == assemblyName);
 		}
 
 		#endregion
