private void BatchToRedis(IDatabase db, List <DProductDay> arr, int BatchSize) { long t = DateTime.Now.Ticks; int cIdx = 0; HashEntry[] hash = new HashEntry[BatchSize]; for (int i = 0; i < 100000; i++) { string json = Newtonsoft.Json.JsonConvert.SerializeObject(arr[i]); hash[cIdx] = new HashEntry(arr[i].SymID.ToString(), json); if (cIdx == BatchSize) { db.HashSetAsync("ProductDay", hash); cIdx = 0; } } if (cIdx != 0) { db.HashSetAsync("ProductDay", hash.Take(cIdx).ToArray()); } t = DateTime.Now.Ticks - t; Console.WriteLine("Batch By : " + BatchSize.ToString() + "HashSetAsync : 計時:" + (t / 10000000.0).ToString("0.00000") + " sec"); db.KeyDeleteAsync("ProductDay"); System.Threading.Thread.Sleep(2 * 1000); }