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
should i use Json.net for json serialization and use RedisClient.Get instead?
You’re likely getting hit by the first cache hit penalty.
Take the first of each call of each API out of the timings.
The RedisClient uses the JsonSerializer underneath, which does exactly the same thing, pulls a string from Redis and calls JsonSerializer to deserialize the type.