11 Commits
Author SHA1 Message Date
Peter Adams 1118370ec4 Apply swift-format changes and CI (#472)
Motivation:

Standardised formatting makes the project cleaner to look at and work
on.

Modifications:

Setup swift-format with the same settings as Swift-NIO

Result:

Common formatting throughout
2024-10-29 13:09:54 +00:00
Rick Newton-Rogers 285e444b49 Sendability warnings (#417)
Motivation:

To address warnings revealed with
`.enableExperimentalFeature("StrictConcurrency=complete"),` in Swift 5.8

Modifications:

* Numerous protections of state in tests
* Make the multiplexer instances explicitly loop bound
* Update channel initializers to be marked as Sendable
* Mark error backing storage types as unchecked sendable

Result:

Better thread safety
2023-11-01 14:36:38 +00:00
George Barnett ed25fecd40 HPACKHeaders performance test for HTTPHeader normalisation (#346)
Motivation:

`HPACKHeaders` has an `init` which will normalize `HTTPHeaders`, this
includes removing any headers which are illegal in HTTP2 and any headers
which present as a 'connection' header value. As written this is
expensive in some edges cases. With perf tests we can validate that
implementation changes improve performance.

Modifications:

Add a performance test to normalize `HTTPHeaders`. This is run on two
configurations.

Result:

More insight into header normalisation perf.
2022-05-17 09:31:47 +01:00
George Barnett 80f02ef18a Add perf and alloc tests for getting headers (#303)
Motivation:

To justify performance changes we need to measure the code being
changed. We believe that `HPACKHeaders.subscript(canonicalForm:)` is a
little slow.

Modifications:

- Add allocation and performance tests for fetching header values in
  their canonical form

Results:

More benchmarks.
2021-09-27 12:43:35 +01:00
Cory Benfield dbfc8fcd1a Clean up imports and dependencies. (#300)
Motivation:

With NIO 2.32.0 we broke the core NIO module up into modules that split
apart the POSIX layer and the core abstractions. As a result, this
package no longer needs to express a hard dependency on the POSIX layer.

Modifications:

- Rewrote imports of NIO to NIOCore.
- Added NIOEmbedded imports where necessary in tests.
- Note that the main modules still depend on NIO, which is necessary
    for backwards-compatibility reasons. This dependency is unused.

Result:

No need to use NIOPosix.
2021-09-14 11:30:04 +01:00
Cory Benfield 59941f6803 Re-add "run all" mode to performance tester (#272)
The run-all mode of the performance tester inadvertently got removed in
a previous patch. This adds it back.

Along the way we have apparently unlocked some perf gains in a new NIO
release.
2021-01-11 17:12:55 +00:00
Cory Benfield ec1fad4c07 Move the huffman benchmark base64 out of init (#262)
Motivation:

The init() of all benchmarks will execute, even when we filter a
benchmark run down to a single benchmark. We should avoid doing heavy
work there, because it can confuse us when we look at traces elsewhere.

Modifications:

- Move some heavy work in the huffman benchmark base64 decode out of
  init().
- Prevent setUp() and tearDown() from running if a test is filtered out.
- Avoid even creating benchmarks unless they're filtered in.

Result:

Less confusing benchmark traces.
2020-11-26 08:43:13 +00:00
Cory Benfield 3315a639de Add benchmark and alloc test for GOAWAY teardown. (#260)
Motivation:

We don't have any benchmarks or alloc counter tests for doing stream
teardown with GOAWAY frames. While this isn't a terribly hot code path
and isn't terribly performance heavy with allocations, it's good to have
more data here.

Modifications:

- Write benchmarks and alloc counter tests that tear down many streams
  with GOAWAY.

Result:

Better testing and alloc counter.
2020-11-24 17:24:42 +00:00
Cory Benfield 54f15a6b16 Add benchmarks and improve benchmarking. (#256)
Motivation:

Performance benchmarking wants accurate numbers, and a wide range of
possible benchmarks. One way to get somewhat more accurate numbers is to
use a tool like Cachegrind to measure the instruction counts of a
program. Cachegrind allows us to isolate a number of noise-introducing
effects, as "number of executed instructions" is a much more stable
number than how long a program takes to run.

When running under cachegrind we want to change the way our performance
benchmarks work. Instead of running lots of times to try to average out
noise, we only want to run once to save ourselves time, as the benchmark
itself should be drastically more stable.

While we're here, let's add some much more isolated benchmarks than our
current "make lots of streams" benchmark. This is basically the same
logic, but it does less of NIO and so makes the impact of NIOHTTP2
substantially more prominent.

Modifications:

- Added a cachegrind build mode to the benchmarks.
- Added new benchmarks and alloc counters.

Result:

More info
2020-11-19 11:09:09 +00:00
Cory Benfield 7cc32a9a41 Add HPACK & Huffman benchmarks. (#167)
Motivation:

Having benchmarks for the HPACK encoder and decoder gives us better
insight into their performance. While we have some simple benchmarks in
the XCTests, using the NIO performance tester framework will give us
more insight into what's happening.

While we're here, we can move the Huffman benchmarks out of the unit
tests and into the benchmark suite.

Modifications:

Added encoder, decoder, and huffman benchmarks.

Result:

Better performance numbers.
2019-11-13 08:43:10 +00:00
Johannes Weiss 522464d81e HTTP/2 peformance tests (#117)
Motivation:

NIO wants to be fast, we should have perf tests everywhere.

Modifications:

Start with one HTTP/2 perf test.

Result:

more perf tests.
2019-05-16 18:21:17 +01:00