title: Optimization of in memory load time of image
body: <p>I am using the <code>ImageMagick</code> utility to resize the images. But before that i download the image from S3 and keep it in memory just to reduce time. But still when i print the <code>time taken to get the image from s3</code> and <code>time to load the image in memory</code> it comes out to be <code>300-400 ms</code> and <code>500-900ms</code>. So my question is time to get the image from s3 will depands on from which region i download the image. But <code>time to load the image in memory</code> is taking <code>500-900ms</code>. So is there any way i can optimize it ? </p>
  
  <pre><code>           string accessKey = "ACCESS_KEY";
             string secretKey = "SECRET_KEY";
  
             AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(
                          accessKey,
                          secretKey
                          );         
  
             GetObjectRequest request = new GetObjectRequest
             {
                 BucketName = "BUCKEY_NAME",
                 Key = KeyName
             };
  
             Stopwatch sw = new Stopwatch();
             sw.Start();
             var response = client.GetObject(request);
             sw.Stop();        
             Console.WriteLine("Time to get the image : " + sw.Elapsed.Ticks / TimeSpan.TicksPerMillisecond);
  
             sw.Reset();
             sw.Start();
             MagickImage imgStream = new MagickImage(response.ResponseStream);
             sw.Stop();
             Console.WriteLine("Time to load image in memory : " + sw.Elapsed.Ticks / TimeSpan.TicksPerMillisecond);
  </code></pre>