From bd8fa0561af6380f2ca4cb5e745489baebf232cf Mon Sep 17 00:00:00 2001 From: Timofey Solomko Date: Tue, 10 Apr 2018 00:21:26 +0300 Subject: [PATCH] [Benchmark] Don't take into account "first" iteration --- Sources/swcomp/Benchmarks/CompBz2.swift | 1 + Sources/swcomp/Benchmarks/CompDeflate.swift | 1 + Sources/swcomp/Benchmarks/Info7z.swift | 1 + Sources/swcomp/Benchmarks/InfoTar.swift | 1 + Sources/swcomp/Benchmarks/InfoZip.swift | 1 + Sources/swcomp/Benchmarks/UnBz2.swift | 1 + Sources/swcomp/Benchmarks/UnGzip.swift | 1 + Sources/swcomp/Benchmarks/UnXz.swift | 1 + 8 files changed, 8 insertions(+) diff --git a/Sources/swcomp/Benchmarks/CompBz2.swift b/Sources/swcomp/Benchmarks/CompBz2.swift index 0c64a616..8d4667ec 100644 --- a/Sources/swcomp/Benchmarks/CompBz2.swift +++ b/Sources/swcomp/Benchmarks/CompBz2.swift @@ -33,6 +33,7 @@ class CompBz2: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = BZip2.compress(data: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/CompDeflate.swift b/Sources/swcomp/Benchmarks/CompDeflate.swift index 08e97051..5fba6ad4 100644 --- a/Sources/swcomp/Benchmarks/CompDeflate.swift +++ b/Sources/swcomp/Benchmarks/CompDeflate.swift @@ -33,6 +33,7 @@ class CompDeflate: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = Deflate.compress(data: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/Info7z.swift b/Sources/swcomp/Benchmarks/Info7z.swift index 5dd915bb..a315926d 100644 --- a/Sources/swcomp/Benchmarks/Info7z.swift +++ b/Sources/swcomp/Benchmarks/Info7z.swift @@ -33,6 +33,7 @@ class Info7z: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try SevenZipContainer.info(container: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/InfoTar.swift b/Sources/swcomp/Benchmarks/InfoTar.swift index 84ff9b71..89852bf9 100644 --- a/Sources/swcomp/Benchmarks/InfoTar.swift +++ b/Sources/swcomp/Benchmarks/InfoTar.swift @@ -33,6 +33,7 @@ class InfoTar: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try TarContainer.info(container: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/InfoZip.swift b/Sources/swcomp/Benchmarks/InfoZip.swift index 5077ec2b..53a12eb8 100644 --- a/Sources/swcomp/Benchmarks/InfoZip.swift +++ b/Sources/swcomp/Benchmarks/InfoZip.swift @@ -33,6 +33,7 @@ class InfoZip: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try ZipContainer.info(container: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/UnBz2.swift b/Sources/swcomp/Benchmarks/UnBz2.swift index e985cf3e..3a4c8788 100644 --- a/Sources/swcomp/Benchmarks/UnBz2.swift +++ b/Sources/swcomp/Benchmarks/UnBz2.swift @@ -33,6 +33,7 @@ class UnBz2: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try BZip2.decompress(data: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/UnGzip.swift b/Sources/swcomp/Benchmarks/UnGzip.swift index 087f1496..8639aa06 100644 --- a/Sources/swcomp/Benchmarks/UnGzip.swift +++ b/Sources/swcomp/Benchmarks/UnGzip.swift @@ -33,6 +33,7 @@ class UnGzip: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try GzipArchive.unarchive(archive: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent() diff --git a/Sources/swcomp/Benchmarks/UnXz.swift b/Sources/swcomp/Benchmarks/UnXz.swift index 6835a928..5b797f6d 100644 --- a/Sources/swcomp/Benchmarks/UnXz.swift +++ b/Sources/swcomp/Benchmarks/UnXz.swift @@ -33,6 +33,7 @@ class UnXz: Command { var maxTime = Double(Int.min) var minTime = Double(Int.max) + _ = try XZArchive.unarchive(archive: fileData) for i in 1...10 { print("Iteration \(i): ", terminator: "") let startTime = CFAbsoluteTimeGetCurrent()