We’re excited to introduce the new Azure Storage client libraries for JavaScript in Beta. These new libraries come with a new dependency on Azure Core (CoreV2), which comes with substantial performance improvements. This article summarizes the new changes to the JavaScript client libraries and shows off some performance improvements in the @azure/storage-blob
library.
Because this library is a Beta release, we highly encourage you to try out these new libraries in your own environment and provide feedback in our GitHub repository.
Change summary
In short, the largest change from these Beta JavaScript libraries versus the latest stable release is the shift to a newer Azure Core dependency (CoreV1 to CoreV2). The Azure Core team worked closely with the Storage team to incorporate these changes, which improve performance substantially!
The main change in CoreV2 is the splitting of @azure/core-http
into three separate packages: @azure/core-rest-pipeline
, @azure/core-client
, and @azure/core-xml
. This separation allows for smaller dependency graphs and bundles for individual client libraries, facilitating the creation of plug-in libraries based on new requirements. On top of lower bundle sizes, this new pattern allows for more request pipeline customization, improved authentication support with our new Azure Identity library, and most importantly, performance. Additionally, a new package called @azure/core-http-compat
was created to avoid breaking changes and a new API to deal with for customers. This compatibility library ensures that any HTTP pipeline customizations made inside of the Azure Storage libraries are compatible with Azure Core V2. The best part about the change from CoreV1 to CoreV2 is that these benefits are across all of the Azure client libraries, not just Storage!
If you’re more curious about our CoreV2 upgrade and some more performance testing, you can check out Azure SDK Engineer Harsha Nalluru’s blog post here: Evolving Core Stack of Azure SDK for JS: A Tale of Enhanced Performance, Usability, and Convenience.
Switch to CoreV2
The Azure SDK for JavaScript team worked closely with the Azure Storage team to ensure that this Beta release would come with no breaking changes, despite the major dependency bump. This means that if you’re a current user of the Azure Storage client libraries for JavaScript, you can get a performance bump for free! The only requirement to receive these performance improvements is to upgrade to the Beta versions of the JavaScript client libraries for your respective Storage use case.
For your convenience, the Beta versions of the Azure Storage JavaScript client libraries are listed here.
- @azure/storage-blob: version 12.23.0-beta.1
- @azure/storage-queue: version 12.22.0-beta.1
- @azure/storage-file-datalake: version 12.22.0-beta.1
- @azure/storage-file-share: version 12.23.0-beta.1
Performance test structure
A performance benchmark was done on the new Beta releases versus their previous stable version counterpart, which had a dependency on CoreV1.
The environment used for these performance tests was as follows:
- CPU: Azure VM with Standard D32s v3 (32 VCPUs, 128-GiB memory)
- Disk: Uploading/downloading/from memory, so configuration isn’t relevant
- Storage Account: General Purpose v2/LRS (Locally redundant storage)
The tests ran each operation five times and their times were averaged.
Performance breakdown
In short, improvements in time spent were observed to be up to 19% for blob uploads and up 29% for blob downloads. Metadata operations (for example, SetMetadata
) are up to 50% faster! Check out the numbers!
Blob upload
Test benchmark | Core Version | Test 1 time (ms) | Test 2 time (ms) | Test 3 time (ms) | Test 4 time (ms) | Test 5 time (ms) | Average | Improvement |
---|---|---|---|---|---|---|---|---|
4K*10000 uploading await on one | CoreV2 | 127009 | 129114 | 128965 | 129619 | 130108 | 128963 | 19.4% |
CoreV1 | 159845 | 160441 | 161529 | 159427 | 158969 | 160042.2 | ||
4K * 100000 uploading await on ten | CoreV2 | 72660 | 74887 | 74129 | 74388 | 75645 | 74341.8 | 5% |
CoreV1 | 79057 | 78308 | 78426 | 77759 | 78488 | 78407.6 | ||
1G * 10 await on one | CoreV2 | 109800 | 111783 | 109446 | 112295 | 113420 | 111348.8 | 12% |
CoreV1 | 126594 | 127221 | 127849 | 126524 | 125130 | 126663.6 | ||
1G * 10 awaits on ten | CoreV2 | 108158 | 106564 | 108517 | 107590 | 108476 | 107861 | 28% |
CoreV1 | 145946 | 147700 | 147464 | 152476 | 156634 | 150044 |
Blob download
Test benchmark | Core Version | Test 1 time (ms) | Test 2 time (ms) | Test 3 time (ms) | Test 4 time (ms) | Test 5 time (ms) | Average | Improvement |
---|---|---|---|---|---|---|---|---|
4K*100000 downloading await on 10 | CoreV2 | 155780 | 156703 | 156662 | 157508 | 156210 | 156572.6 | 29% |
CoreV1 | 220933 | 220202 | 221337 | 221476 | 220192 | 220828 | ||
4K * 10000 downloading await on 1 | CoreV2 | 82407 | 81785 | 82439 | 83381 | 84024 | 82807.2 | 8% |
CoreV1 | 91419 | 90386 | 90626 | 90353 | 90250 | 90606.8 | ||
1G * 10 await on 10 | CoreV2 | 37429 | 39540 | 37498 | 39622 | 37482 | 38314.2 | 12% |
CoreV1 | 42426 | 43096 | 42528 | 45654 | 43957 | 43666.2 |
Set metadata
Test benchmark | Core Version | Test 1 time (ms) | Test 2 time (ms) | Test 3 time (ms) | Test 4 time (ms) | Test 5 time (ms) | Average | Improvement |
---|---|---|---|---|---|---|---|---|
SetMetadata 10000 wait on 10 | CoreV2 | 18163 | 17734 | 18020 | 18119 | 18109 | 18029 | 52.7% |
CoreV1 | 38266 | 37736 | 38645 | 38163 | 37917 | 38145.4 |
Summary
The new Beta of the Azure Storage client libraries for JavaScript is now released and has notable performance improvements. In this article, we summarized the major changes from this Beta release versus the previous stable release and showed off some performance numbers. The Azure SDK team is excited for you to try these Beta libraries and provide any feedback as we work on finalizing a stable release in the coming months. As a reminder, you can leave your feedback in the GitHub repository.
0 comments