mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-25 04:47:50 +00:00
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.
20 lines
596 B
Swift
20 lines
596 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the SwiftNIO open source project
|
|
//
|
|
// Copyright (c) 2019 Apple Inc. and the SwiftNIO project authors
|
|
// Licensed under Apache License v2.0
|
|
//
|
|
// See LICENSE.txt for license information
|
|
// See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
protocol Benchmark: class {
|
|
func setUp() throws
|
|
func tearDown()
|
|
func run() throws -> Int
|
|
}
|