Работа с ~ 4600 объектами в схеме EAV с общим количеством около 140 000 атрибутов, представляющих менее 25 МБ при сериализации в одну коллекцию;не уверен точно, насколько велики при сериализации, как они есть, 4600 отдельных кэшированных элементов.
Чтобы обойти проблемы со временем загрузки схемы атрибутов EAV, мы пытаемся заполнить AppFabric при запуске, а также опираться налокальный кеш.Тем не менее, я наблюдаю очень низкую производительность, когда оценивается IEnumerable из GetObjectsByTag или GetObjectsInRegion:
var products = new Dictionary<string, ProductContract>();
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " retrieving object collection from cache");
//object productsObj = _cache.Get(ProductCollectionNameInCache, this.CacheRegion);
//var productsObjUneval = _cache.GetObjectsByTag(ProductCacheTag, this.CacheRegion);
var productsObjUneval = _cache.GetObjectsInRegion(this.CacheRegion);
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " retrieving object collection from cache complete");
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " evaluating IEnumerable object");
var productsObj = productsObjUneval.Where(p=>p.Key != ProductsPrimedFlagNameInCache).ToList();
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " end evaluating IEnumerable object");
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " converting object collection to Dictionary<string, ProductContract>");
products = productsObj.ToDictionary(p => p.Key, p => (ProductContract) p.Value);
Trace.WriteLine(DateTime.Now.ToLongTimeString() + " end converting object collection to Dictionary<string, ProductContract>");
Выход EventLog:
Level Date and Time Source Event ID Task Category
Information 4/27/2011 12:55:22 PM EPC Service 0 None 12:55:22 PM end getting products from cache
Information 4/27/2011 12:55:22 PM EPC Service 0 None 12:55:22 PM end converting object collection to Dictionary<string, ProductContract>
Information 4/27/2011 12:55:22 PM EPC Service 0 None 12:55:22 PM converting object collection to Dictionary<string, ProductContract>
Information 4/27/2011 12:55:22 PM EPC Service 0 None 12:55:22 PM end evaluating IEnumerable object
Information 4/27/2011 12:55:05 PM EPC Service 0 None 12:55:05 PM evaluating IEnumerable object
Information 4/27/2011 12:55:05 PM EPC Service 0 None 12:55:05 PM retrieving object collection from cache complete
Information 4/27/2011 12:55:05 PM EPC Service 0 None 12:55:05 PM retrieving object collection from cache
Information 4/27/2011 12:55:05 PM EPC Service 0 None 12:55:05 PM getting products from cache
Information 4/27/2011 12:55:05 PM EPC Service 0 None 12:55:05 PM is cache primed? True
Редактировать: делать вызовы для всех объектов по тегуили все объекты в регионе ВСЕГДА идут против распределенного кэша, а не локального?Это было бы очень обидно и совершенно бесполезно для наших нужд.http://social.msdn.microsoft.com/forums/en-us/velocity/thread/C0F1863A-87D6-43BC-8EA5-667F072040D2