Skip to content

Use of non-canonical MIME headers causes unnecessary string allocations in storage SDKs #26405

@taywrobel

Description

@taywrobel

Bug Report

  • What happened?

The GMT time normalization for headers introduced in PR #20495 uses non-canonical MIME headers for the headers in the storage/azblob SDK:

  • x-ms-source-if-modified-since (canonically X-Ms-Source-If-Modified-Since)
  • x-ms-source-if-unmodified-since (canonically X-Ms-Source-If-Unmodified-Since)
  • x-ms-immutability-policy-until-date (canonically X-Ms-Immutability-Policy-Until-Date)

net/http.Header.Get canonicalizes the header if it's not already in the canonical format. This results in 3 unnecessary allocations per query, which under systems with high concurrent load can add up.

Image

Since this PR was merged the same autorest rules were applied to the storage/azdatalake SDK as well in PR #21387.

  • What did you expect or want to happen?
    Use header keys which are already canonical to avoid unnecessary allocations.

  • How can we reproduce it?
    Run a large azblob or azdatalake workload with profiling.

  • Anything we should know about your environment.
    go version go1.25.6 darwin/arm64, however issue is version and architecture agnostic

Metadata

Metadata

Assignees

No one assigned

    Labels

    customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageWorkflow: This is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions