Reputation: 936
I have an application which loads different blobs from the same container stored on Azure blob storage with the following code snippet
var cloudStorageAccount = CloudStorageAccount.Parse(buildGraphRequest.AzureBlobConnectionString);
var bolbClient = new CloudBlobClient(cloudStorageAccount.BlobEndpoint, cloudStorageAccount.Credentials);
var container = bolbClient.GetContainerReference(buildGraphRequest.BlobContainerName);
var blob = container.GetBlobReference(filename);
I'm not sure if there is any performance difference if I execute the code above everytime I want to get a hold of a blob, or I can initialize the container
once and use the same container
object every time.
The closest thing I can find is this post. Connection pooling on Azure Storage
Upvotes: 0
Views: 614
Reputation: 42153
According to the information in the post you have mentioned, the Azure Blob Storage is essentially an HTTP connection which is Request/Response based, after sending response, it will be terminated.
But as @Gaurav Mantri said,
These statements do not make a network call. They just create an instance of these objects so there is no network latency related overhead when you create instances of these objects.
So I think it will be no network latency about performance, it will just waste some cycles creating objects.
Upvotes: 0