GithubHelp home page GithubHelp logo

Comments (3)

yoshuawuyts avatar yoshuawuyts commented on June 3, 2024

In most cases, we parse a url from host and path and then later on only use the path for routing.

When routing on the path we do need to parse the URL in order to filter out the query string, and normalize URL escaping. We can probably skip parsing the URL in async-h1, but I'm not sure to which degree it's feasible for e.g. tide.

If we think we'll have to parse URLs for tide anyway, is it still worth adding extra logic to async-h1 to not always have to parse them?

from async-h1.

jbr avatar jbr commented on June 3, 2024

It might be worth checking if percent_encoding::percent_decode_str(path.split("?").next()) is faster than Url decode. However, this would have to happen at the same time as http-types v3, since there is currently no way to construct a Request without a full Url.

from async-h1.

jbr avatar jbr commented on June 3, 2024

I also think it's worth asking why we need to parse urls for tide. Why does the host and path have to be represented as a Url specifically?

Alternatively, we could try to add a constructor for Url, or fork Url to add a constructor, since currently we are concatenating strings and then parsing them in order to construct a Url from scheme, host and path

from async-h1.

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.