-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add boilerplate for using swift-collection-benchmarks.
Add baseline interspersed-results and interspersed-chart.png. Update CONTRIBUTING.md for benchmarking instructions.
- Loading branch information
1 parent
50be2c8
commit 506dd7e
Showing
5 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the Swift Algorithms open source project | ||
// | ||
// Copyright (c) 2021 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import Foundation | ||
import Algorithms | ||
import CollectionsBenchmark | ||
|
||
/// Benchmarks `.intersperse` from Swift Algorithms for Array<Int> sequences. | ||
func benchmarkInterspersed() { | ||
var benchmark = Benchmark(title: "Interspersed Benchmark") | ||
|
||
benchmark.addSimple( | ||
title: "Array<Int> interspersed", | ||
input: Array<Int>.self | ||
) { input in | ||
blackHole(input.interspersed(with: 9)) | ||
} | ||
|
||
benchmark.main() | ||
} | ||
|
||
print(benchmarkInterspersed()) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"version":1,"tasks":[{"title":"Array<Int> interspersed","results":{"57344":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"786432":[1.67e-09,1.67e-09,1.8636363636363636e-09,2.0800000000000003e-09,2.0800000000000003e-09],"1280":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"48":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"458752":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"56":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"98304":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"64":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"131072":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"20480":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"80":[1.67e-09,1.75e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"1":[1.8260869565217392e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"2":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"768":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"3":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"4":[1.8260869565217392e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"320":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"393216":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"5":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"6":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"10240":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"7":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"24576":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"10":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"8":[1.67e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"896":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"163840":[1.67e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"917504":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"3584":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.5000000000000001e-09],"40960":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"524288":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"1536":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.09e-09],"12":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"2560":[1.8260869565217392e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"65536":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"229376":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"327680":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"512":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"20":[1.67e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"81920":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"655360":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.5000000000000001e-09],"14336":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"14":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"96":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"12288":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"128":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"49152":[1.67e-09,1.67e-09,1.67e-09,1.67e-09,2.0800000000000003e-09],"16":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"640":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"192":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"24":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"4096":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"32":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"2048":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"256":[1.6600000000000001e-09,1.67e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09],"3072":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.09e-09,2.09e-09],"1792":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"40":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"28672":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"1024":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"262144":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"1048576":[1.6600000000000001e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"7168":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"8192":[1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"28":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"32768":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"6144":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"384":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"160":[1.6600000000000001e-09,1.67e-09,1.67e-09,2.0800000000000003e-09,2.0800000000000003e-09],"5120":[1.8260869565217392e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"448":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"114688":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"16384":[1.6600000000000001e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.09e-09],"112":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"224":[2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09],"196608":[1.75e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09,2.0800000000000003e-09]}}]} |