Commit Graph
16 Commits
Author SHA1 Message Date
Fabian Fett 43cf84fb56 Reimplement HTTPFields on top of a simple Array (#138)
### Motivation

We like faster and simpler code. When optimizing performance we focus on
often used use-cases.

### Changes

- Reimplement HTTPFields on top of a simple Array

### Result

- HTTPFields building becomes significantly faster
- HTTPFields lookups are faster for small fields, and only slightly
slower for larger (nearly always offset by reduced build time)

Follow ups:

- Make the equality implementation smarter
2026-08-18 14:26:31 +02:00
Fabian Fett e84a4ff0bc [Benchmark] Rewrite benchmarks to be scaling (#136)
### Motivation

As in #133 stated, we want to make performance improvements based on
numbers. However in #133 we only introduced benchmarks for
`HeaderFields` that are a fixed size long. This PR introduces scaling
benchmarks so that we can test `HeaderFields` with different lengths
(N=8, 16, 32, 64, 128)

### Changes

- Add scaling `HeaderFields` benchmarks
- Remove fixed size `HeaderFields` benchmarks

### Result

A clearer view into performance.
2026-08-14 11:17:11 +02:00
Fabian Fett 37b3778072 Stop copying the name index dictionary on every HTTPFields.append (#134)
### Motivation

`_Storage.append(field:)` updated the name index through optional
chaining:

  self.index?[name, default: (first: location, last: 0)].last = location

The optional chaining self.index? is expanded into

  if var index = self.index {
index[name, default: (first: location, last: 0)].last = location // this
allocates – as dict is referenced by self.index and index
    self.index = index
  }

Because of this we have an allocation on every append.

### Changes

Nil-check `self.index` once, then mutate through the force-unwrapped
`self.index![name] = ...`, which is an addressable projection of the
stored property and mutates in place.

### Result

Allocations drop on every append-driven path.
2026-08-12 16:28:16 +02:00
Fabian Fett 8ec4cbcfa3 Add Benchmarks (#133)
### Motivation

We want to measurably improve performance.

### Changes

- Add a selection of use-cases that we can use to optimize our code
- Add thresholds for the newly added benchmarks so that we can ensure
that we don't regress in CI

### Result

A great baseline to start performance work.
2026-08-12 12:39:04 +00:00
Rick Newton-RogersandGuoye Zhang c98018204b Drop Swift 6.0 (#114)
Motivation:

Swift 6.0 is no longer supported, we should bump the tools version and
remove it from our CI.

Modifications:

* Bump the Swift tools version to Swift 6.1
* Remove Swift 6.0 jobs where appropriate in main.yml, pull_request.yml

Result:

Code reflects our support window.

---------

Co-authored-by: Guoye Zhang <guoye_zhang@apple.com>
2026-04-01 21:51:13 +01:00
Rick Newton-Rogers 1eb908f88d Enable Swift 6.3 jobs in CI (#113)
Motivation:

Swift 6.3 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.3 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2026-04-01 13:55:25 +01:00
Rick Newton-Rogers 4366cd1e64 Enable Swift 6.2 jobs in CI (#105)
Motivation:

Swift 6.2 has been released, we should add it to our CI coverage.

Modifications:

Add additional Swift 6.2 jobs where appropriate in main.yml,
pull_request.yml

Result:

Improved test coverage.
2025-10-01 16:23:41 +01:00
Rick Newton-Rogers 4d7c10f344 add thresholds for Swift 6.1 from 6.0 thresholds (#100) 2025-04-14 12:16:08 +01:00
Rick Newton-Rogers 5d11d38230 Rename nightly_6_1 params to nightly_next (#91)
Rename nightly_6_1 params to nightly_next; see
https://github.com/apple/swift-nio/pull/3122
2025-03-03 15:26:53 +00:00
Guoye Zhang 74191f0834 Update benchmark threshold to Swift 6.1 (#83) 2025-01-25 11:57:02 -08:00
Guoye Zhang 06a234b69b Update baseline 2024-10-28 18:00:33 -07:00
Franz Busch 5eeef940dd Fix checks 2024-10-28 11:13:19 +01:00
Franz Busch f3d9ec3eef [CI] Make all CI checks green
# Motivation

We just adopted GH actions and want to make sure all the CI checks are green.

# Modification

This PR makes the necessary changes to pass all checks. Including:

- Adding a licenseignore file
- Moving `swift-format` and adopting the config that we use in all other swift on server repos.

# Result

Green CI.
2024-10-24 22:30:18 +02:00
Guoye Zhang 291e929d94 Add conveniences for modern HTTP parsers 2024-06-18 20:22:37 -07:00
Guoye Zhang 9afb2bd755 Update contributors 2024-05-13 11:09:06 -07:00
Joannis Orlandos 363f7aee95 Added benchmark 2024-02-01 00:32:25 +01:00