mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-28 05:14:25 +00:00
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
This commit is contained in:
1 parent
93586110f2
commit
1118370ec4
125 files changed
+21869
-11457
No files matched your search
@@ -15,7 +15,6 @@
|
||||
import NIOCore
|
||||
import NIOHPACK
|
||||
|
||||
|
||||
/// This benchmark is mostly attempting to stress the Huffman Encoding implementation by
|
||||
/// way of using larger or more complex strings.
|
||||
final class HuffmanEncodingBenchmark {
|
||||
@@ -34,14 +33,13 @@ final class HuffmanEncodingBenchmark {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension HuffmanEncodingBenchmark: Benchmark {
|
||||
func setUp() throws {
|
||||
// Run a single iteration of the loop. This warms up the encoder and decoder and ensures all the pages are mapped.
|
||||
try self.loopIteration()
|
||||
}
|
||||
|
||||
func tearDown() { }
|
||||
func tearDown() {}
|
||||
|
||||
func run() throws -> Int {
|
||||
for _ in 0..<self.loopCount {
|
||||
@@ -57,17 +55,17 @@ extension HuffmanEncodingBenchmark: Benchmark {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extension String {
|
||||
static let basicHuffmanString: String = {
|
||||
var text = "Hello, world. I am a header value; I have Teh Texts. I am going on for quite a long time because I want to ensure that the encoded data buffer needs to be expanded to test out that code. I'll try some meta-characters too: \r\t\n ought to do it, no?"
|
||||
static let basicHuffman: String = {
|
||||
var text =
|
||||
"Hello, world. I am a header value; I have Teh Texts. I am going on for quite a long time because I want to ensure that the encoded data buffer needs to be expanded to test out that code. I'll try some meta-characters too: \r\t\n ought to do it, no?"
|
||||
while text.count < 1024 * 128 {
|
||||
text += text
|
||||
}
|
||||
return text
|
||||
}()
|
||||
|
||||
static let complexHuffmanString: String = {
|
||||
static let complexHuffman: String = {
|
||||
var text = "午セイ谷高ぐふあト食71入ツエヘナ津県を類及オモ曜一購ごきわ致掲ぎぐず敗文輪へけり鯖審ヘ塊米卸呪おぴ。"
|
||||
while text.utf8.count < 128 * 1024 {
|
||||
text += text
|
||||
|
||||
Reference in new issue
Block a user