public class MyEntity
{
public string Att1 { get; set; }
public DateTime Att2 { get; set; }
public KeyValuePair Att3 { get; set; }
public Dictionary Att4 { get; set; }
}
var list = new List<MyEntity>(100);
//put to cache .....
var cached = RedisClient.Get<List<MyEntity>>(key) ; // take 9745.9745 ms
var raw = RedisClient.Get(key); //get raw of the same key just take < 10 ms我应该使用Json.net进行json序列化,而使用RedisClient.Get吗?
发布于 2012-11-09 11:32:50
你可能会受到第一次缓存命中惩罚的影响。从计时中取出每个API的每个调用的第一个。
RedisClient使用底层的JsonSerializer,它执行完全相同的操作,从Redis中提取一个字符串,并调用JsonSerializer来反序列化该类型。
https://stackoverflow.com/questions/13301334
复制相似问题