Added measure basline comments to DecoderTests measure tests

This commit is contained in:
Caleb Kleveter 2019-04-19 10:00:35 -05:00
parent 5afcfbb45f
commit 413c17eb94
No known key found for this signature in database
GPG Key ID: B38DBD5CF2C98D69
2 changed files with 4 additions and 0 deletions

View File

@ -39,6 +39,7 @@ final class DecoderTests: XCTestCase {
let bytes = chunks.map { Array($0.utf8) }
let contentLength = chunks.reduce(0) { $0 + $1.count }
// Baseline: 0.062
measure {
for _ in 0..<1_000 {
let decoder = CSVDecoder().async(for: Person.self, length: contentLength) { _ in return }
@ -84,6 +85,7 @@ final class DecoderTests: XCTestCase {
func testSyncDecodeSpeed() throws {
let csv = Data(data.utf8)
// Baseline: 0.066
measure {
for _ in 0..<1_000 {
let decoder = CSVDecoder().sync

View File

@ -15,6 +15,7 @@ final class EncoderTests: XCTestCase {
}
func testMeasureAsyncEncode() {
// 0.502
measure {
for _ in 0..<10_000 {
@ -41,6 +42,7 @@ final class EncoderTests: XCTestCase {
}
func testMeasureSyncEncode() {
// 0.583
measure {
for _ in 0..<10_000 {