Commit Graph

242 Commits

Author SHA1 Message Date
Xiaodi Wu
57cf4ce563 [benchmark] Add integer-to-string benchmark (#85209)
A companion to #85180.

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->
2025-11-03 11:05:26 -05:00
Aidan Hall
8632e58825 Create Pack Specialisation pass 2025-10-30 14:28:16 +00:00
Erik Eckstein
60efd32283 benchmarks: Remove the StackPromo benchmark and make it a lit test
This benchmark just wants to test if stack promotion of an array literal works.
This is so simple that it's better tested with a lit test.
2025-10-10 14:20:59 +02:00
Slava Pestov
48eddac961 Benchmarks: Add support for async benchmarks 2025-08-27 10:37:10 -04:00
Slava Pestov
e6b77812ef New "Monoids" benchmark 2025-07-23 17:26:48 -04:00
Gabor Horvath
3dda301496 [cxx-interop] Reenable C++ benchmarks
The underlying issue was fixed in #82309

rdar://149402670
2025-06-24 17:57:42 +01:00
Meghana Gupta
ec97a16281 Disable C++ interop benchmarks 2025-04-22 11:25:02 -07:00
Nate Cook
e12e968570 Add contains(_:) methods to (Closed)Range (#76891)
The _StringProcessing module provides a generic, collection-based
`contains` method that performs poorly for ranges and closed ranges.
This addresses the primary issue by providing concrete overloads
for Range and ClosedRange which match the expected performance for
these operations.

This change also fixes an issue with the existing range overlap tests.
The generated `(Closed)Range.overlap` tests are ignoring the "other"
range type when generating ranges for testing, so all overlap tests
are only being run against ranges of the same type. This fixes things
so that heterogeneous testing is included.
2024-11-12 11:47:24 -08:00
smonteiro2
6ed0091630 [cxx-interop] Benchmarks for std::span in Swift
* std::span is not supported in swift-ci linux
* explicitly pass -std=c++20 in Package.swift: rdar://136138941
2024-09-17 17:48:56 +01:00
Artem Chikin
9c28427eff Revert "[cxx-interop] Create benchmarks for using std::span in Swift" 2024-09-10 10:18:42 -07:00
smonteiro2
6239c10cc6 [cxx-interop] Create benchmarks for using std::span in Swift
* swift-ci linux tests do not support std::span
2024-09-09 12:47:08 +01:00
Nate Chandler
88c5fc17b2 [Benchmark] Disable Cxx{VectorSum,SetToCollection}.
The two benchmarks don't currently build in some configurations.  Also
disabled building ReadAccessor whose running had previously been
disabled because it doesn't build anymore.

rdar://128520766
2024-06-06 07:23:37 -07:00
Mykola Pokhylets
6298d41edf Reapply "Fix quadratic performance of the ListMerger in specific usage pattern"
This reverts commit 2640ff613b.
2024-05-30 13:08:42 +02:00
Andrew Trick
2640ff613b Revert "Fix quadratic performance of the ListMerger in specific usage pattern" 2024-05-21 16:23:57 -07:00
Mykola Pokhylets
69f54501d4 Added benchmark for adding jobs to default actor when visiting a tree 2024-05-10 11:05:22 +02:00
Nate Cook
38e1370884 Revert "Revert count(where:)" (#70816)
* Revert "Revert count(where:)"

This reverts commit 779ea19a6a.

Now that SE-0220 has been re-accepted, this adds the `count(where:)` 
Sequence method to the standard library.
2024-03-29 13:53:53 -05:00
Oscar Byström Ericsson
e6cc57f321 FlattenSequence/distance(from:to:) benchmarks (v2).
1. Registered the new benchmarks in benchmark/utils/main.swift.
2024-02-22 10:11:41 +01:00
Oscar Byström Ericsson
0ea89852da FlattenSequence/distance(from:to:) benchmarks (#71648). 2024-02-21 17:33:30 +01:00
Lucy Satheesan
51c62aee19 [benchmark] add removeAll(keepingCapacity: true) non-unique test 2023-05-23 11:05:59 -07:00
David Smith
9b3bd5ed0a register new benchmarks 2023-05-09 15:33:09 -07:00
Valeriy Van
dd22e6a43c Removes slash from benchmrk name.
Slash in benchmark name makes benchmarks break.
2023-02-28 11:35:31 +02:00
Valeriy Van
bfb1e875af Adds benchmark for String(repeating:count:) 2023-02-28 11:35:31 +02:00
Valeriy Van
fa6c038c92 Adds benchmarks for UTF16 decoding 2023-02-14 12:04:29 +02:00
swift-ci
afe43a4699 Merge pull request #63106 from valeriyvan/Benchmark-UnsafeRawBufferPointer-first
[benchmark] Add benchmark for UnsafeMutableRawBufferPointer firstIndex(of:) and lastIndex(of:)
2023-01-31 21:34:52 -08:00
Egor Zhdan
d288b16420 [cxx-interop] Add benchmark for conversion between C++ and Swift strings 2023-01-25 00:17:49 +00:00
Egor Zhdan
99c54addb3 Merge pull request #62648 from apple/egorzhdan/cxx-set-bench
[cxx-interop] Add benchmark for std::set conversion to a Swift collection
2023-01-24 23:45:21 +00:00
Valeriy Van
136baafa50 Add benchmark for UnsafeMutableRawBufferPointer firstIndex(of:) and lastIndex(of:) 2023-01-19 18:34:14 +02:00
Egor Zhdan
0da22a3420 [cxx-interop] Add benchmark for std::set conversion to a Swift collection 2023-01-16 16:18:07 +00:00
Karoy Lorentey
f56d44a492 [benchmark] Add a basic benchmark for Unicode._CharacterRecognizer
This measures the performance of the stdlib’s core grapheme breaking algorithm, without any `String` overhead.
2023-01-15 16:10:43 -08:00
Karoy Lorentey
f6b453f30f [benchmark] Add some distance(from:to:) benchmarks for String views 2022-12-27 23:08:05 -08:00
Alex Lorenz
d72b592eeb [cxx-interop] Add initial benchmark to compare vector<uint32_t> sum in C++ vs Swift 2022-10-10 09:13:31 -07:00
Dario Rexin
992cae456b [Frontend] Use experimental feature for layout prespecializations (#61451) 2022-10-06 15:21:01 -07:00
Dario Rexin
210c68d8aa [SILOptimizer] Add prespecialization for arbitray reference types (#58846)
* [SILOptimizer] Add prespecialization for arbitray reference types

* Fix benchmark Package.swift

* Move SimpleArray to utils

* Fix multiple indirect result case

* Remove leftover code from previous attempt

* Fix test after rebase

* Move code to compute type replacements to SpecializedFunction

* Fix ownership when OSSA is enabled

* Fixes after rebase

* Changes after rebasing

* Add feature flag for layout pre-specialization

* Fix pre_specialize-macos.swift

* Add compiler flag to benchmark build

* Fix benchmark SwiftPM flags
2022-09-22 16:29:01 -07:00
fibrechannelscsi
730bf24035 Add benchmarks that measure KeyPath read and write performance. (#60383)
* Add benchmarks that measure KeyPath read and write performance.

* Added setUpFunctions. Revised number of iterations per benchmark.

* Include n as a factor in the number of iterations.

* Increased number of iterations for KeyPathDirectAccess by a factor of 25.

* One last tweak to the number of iterations on testDirectAccess to get them above 20 us.

* Made revisions based on feedback. Added three new benchmarks.

* Added benchmarks to exhaustively benchmark all KeyPathComponent types. Removed benchmarks dealing with an inlining issue.

* Wrapped additional keypaths with identity() where needed. More cleanup and documentation.

* Moved KeyPaths for KeyPathRead and Write into FixedSizeArrayHolder. Renamed GetSet to Getset.

* Added inline(never) to both versions of getKeypathToElement().

* Moved identity() wraps so that they're called once per variable per benchmark.

* Moving destinationKeyPaths into FixedSizeArrayHolder to try to reduce long setup overhead errors.

* Additional moving of the identity() wrapping into the singleton's init() to try to reduce setup time errors.
2022-08-24 13:55:05 -05:00
zoecarver
f3bb988ea0 [nfc] [cxx-interop] Disable ReadAccessor benchmark. 2022-04-29 10:18:10 -07:00
Nuri Amari
cda2c26d8c Create ReadAccessor benchmark
Create a benchmark to test the
performance of synthesized read
accessors generated to interop
with C++ [] operators.
2022-03-07 10:19:25 -05:00
Karoy Lorentey
8944591e71 [benchmark] Simplify benchmark registration 2021-09-15 22:08:08 -07:00
Guillaume Lessard
314220ff07 benchmarks of performance when filling memory buffers 2021-07-28 01:58:33 -06:00
Stephen Canon
9ddbd56d32 Simd random mask benchmark (#36579)
* Add benchmark for SIMDMask.random generation.

* Add bitcast for IntN -> VecNxInt1
2021-03-25 08:54:40 -04:00
Stephen Canon
13812776cc Some initial benchmarks for simd integer arithmetic. 2021-03-19 11:19:35 -04:00
Michael Ilseman
73af20fdbf [benchmark] Add StringSplitting and lines benchmarks
Add a new benchmark module StringSplitting for split-like benchmarking.

Add lineSink benchmarks, which separates Unicode content by lines and feeds
Strings into a sink.
2021-03-04 17:20:12 -07:00
zoecarver
cbfe358065 [benchmark] Add "StringSwitch" benchmark to match "StringEnum".
This benchmark compares 184 strings in a string-based switch statement.
This will be used to test #28260.
2021-01-04 11:33:57 -08:00
Richard Wei
b8581cb83b [AutoDiff] Add differentiation benchmarks (#34901)
* Add differentiation benchmarks.
* Make install name of _Differentiation be @rpath/libswift_Differentiation.dylib.

Co-authored-by: Marc Rasi <marcrasi@google.com>
2020-12-02 12:26:31 -08:00
Zoe Carver
aa04872a16 Merge pull request #32721 from zoecarver/cxx/benchmark/create-objects
[cxx-interop] Add support for benchmarks with C++ interop.
2020-11-20 07:58:16 -08:00
Micah Benn
71784065cb Add IndexPath benchmarks
Add benchmarks for subscripts, max, min
2020-11-01 08:39:51 -06:00
zoecarver
01b12cfe6e [cxx-interop] Add support for benchmarks with C++ interop.
* Adds support for benchmarks that use C++ modules.
* Adds "CreateObjects" benchmark that creates C++ objects.
2020-10-06 19:33:22 -07:00
Xiaodi Wu
65a547c4e6 [benchmark] Add new benchmark for floating-point conversion 2020-09-04 13:42:47 -04:00
Mike Ash
60e12f109d Add a benchmark for protocol conformance testing. 2020-08-14 15:32:51 -04:00
Robert Widmann
cddf73ecdb [Gardening] Clean Up OS-Test Patterns Across The Codebase
Clean up a few general patterns that are now obviated by canImport

This aligns more generally with the cleanup that the Swift Package
Manager has already done in their automated XCTest-plumbing tool in
apple/swift-package-manager#1826.
2020-06-30 22:55:58 -07:00
Ben Cohen
baa3a7dc10 [benchmarks] Add a benchmark for printing using mirrors (#32150)
* Add a benchmark for mirrors and typename->string conversion
2020-06-03 12:06:39 -07:00