swift-server / swift-server/async-http-client

> 8% overall wall time spent for simple HTTP request on NSURL initialisation & related things

Open
#755 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

NSURL initialisation seems to use up about 7% wall time of an overall basic but real HTTP request (over loopback with a fast server), even for basic URLs like http://127.0.0.1:8888/.

This seems pretty steep. The flame graph in the screenshot is 15% of the wall time. ~half of that (the 8%) are just URL.init(string:)

Screenshot 2024-07-23 at 12 14 32 pm

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by profiling a basic loopback HTTP request and inspect the reported flame graph around NSURL initialization and URL.init(string:). Determine whether URL construction accounts for the reported wall-time share, then measure any proposed change against the same request; done means the source of the overhead and a reproducible improvement are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.