GithubHelp home page GithubHelp logo

ClientModel: Investigate whether we can remove PipelineRequestHeaders.TryGetValues( ... IEnumerable ) overload about azure-sdk-for-net HOT 2 CLOSED

annelo-msft avatar annelo-msft commented on May 25, 2024
ClientModel: Investigate whether we can remove PipelineRequestHeaders.TryGetValues( ... IEnumerable ) overload

from azure-sdk-for-net.

Comments (2)

annelo-msft avatar annelo-msft commented on May 25, 2024

Some notes on this investigation:

  • Azure.Core RequestHeaders has a TryGetValues(IEnumerable) overload. We could move the implementation of this into Azure.Core only, but it would mean splitting the implementation of RequestHeaders across libraries.
  • System.Net.Http HttpHeaders has only the TryGetValues(IEnumerable) overload, but it also has an Add(string, IEnumerable), so the type doesn't necessarily have to allocate the collection itself
  • Having TryGetValue(string name, out string? value) side by side with TryGetValues(string name, out IEnumerable<string>? values) is a nice clue to the caller that the header value can be multi-valued. This doesn't appear to be common knowledge from some of the conversations I've had recently.
  • We have this code in Azure.Core today, so this is an opportunity to improve performance in ClientModel, but shouldn't represent a regression to performance with the current implementation
  • I wonder, if there was an efficient way to split over char buffers, if we could support the IEnumerable API without the need to allocate a collection?
  • There are some nice optimizations to the System.Net.Http implementation here. Maybe we continue to support this API in the current state for now to make it easy to have a single implementation across Azure.Core and ClientModel, and come back and optimize it later?

from azure-sdk-for-net.

annelo-msft avatar annelo-msft commented on May 25, 2024

Closing per offline conversation

from azure-sdk-for-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.