VintaSoft Imaging .NET SDK and Plug-ins Discussions

Questions, comments and suggestions concerning VintaSoft Imaging .NET SDK.

Board index < VintaSoft Imaging < VintaSoft Imaging .NET SDK and Plug-ins Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

Mutiple Jpg image in Array is taking time with azure blob response



Mutiple Jpg image in Array is taking time with azure blob response

Post by jwalit.katira »

Hello

In .NET core we have override CreateSessionDataStorage method to give response as blob stream , below is sample code
protected override IDataStorage CreateSessionDataStorage(string sessionId)
{
    return new BlobDataStorage();
}

public class BlobDataStorage : IDataStorage
{
    public object GetItemCopy(string key)
    {
         if (Contains(key))
        {
            var blobclient = new BlobClient("UseDevelopmentStorage=true", "service",key);
            return blobclient.OpenRead();
        }
        else
            throw new Exception(string.Format("Data storage does not have image with identifier \"{0}\".", key));
    }
    ...
the method GetImageFileInfo() is taking almost 1 min to response for 1260 array of jpg . if is is just JSON response cannot we some how give response directly

same method GetImageFileInfo() i override as as response stream from physical 1260 array of jpg file it is only take 3 sec

protected override IDataStorage CreateSessionDataStorage(string sessionId)
{
    if (sessionId == null)
    {
        if (IsEmptySessionSupported)
            sessionId = "";
        else
            throw new ArgumentNullException("sessionId");
    }

    string path = Path.Combine("C:\\Jwalit\\Sample Files\\JPEGNEW\\", sessionId);

    if (!Directory.Exists(path))
        Directory.CreateDirectory(path);

    return new StreamDataStorage(path);
}
can you please suggest

Thanks
Jwalit katira


Re: Mutiple Jpg image in Array is taking time with azure blob response

Post by Alex »

Hello Jwalit,

Please do the following test:
  • Create console application that creates BlobClient object and reads data from 1260 blobs. Run the application and measure the execution time.
  • Create console application that reads bytes from 1260 file streams. Run the application and measure the execution time.
I think as a result you will see that the second application works much faster.

If you want to improve performance of data storage, which loads data from blobs, I think you need to improve performance of blobs.

Best regards, Alexander


Page 1 from 1: 1