[XM] Teach XM resolver to load all of assemblies into memory (#1034)

- Profiling suggesting that loading all of sub-100 MB assemblies into
 memory is a performance win, and mtouch already does it.
This commit is contained in:
Chris Hamons 2016-10-28 07:28:43 -05:00 коммит произвёл Sebastien Pouliot
Родитель c6d7a3adec
Коммит b5edf16711
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -69,7 +69,11 @@ namespace Xamarin.Bundler {
if (cache.TryGetValue (name, out assembly))
return assembly;
assembly = AssemblyDefinition.ReadAssembly (fileName, new ReaderParameters { AssemblyResolver = this });
assembly = AssemblyDefinition.ReadAssembly (fileName, new ReaderParameters
{
AssemblyResolver = this,
InMemory = new FileInfo (fileName).Length < 1024 * 1024 * 100 // 100 MB
});
cache.Add (name, assembly);
return assembly;
}