Commit Graph

509 Commits

Author SHA1 Message Date
Slava Pestov deacce8bf9 New congruence enumeration benchmark 2026-05-14 11:29:58 -04:00
David Smith 5039cccf80 Add a cross-encoding version of strcmp, use it in bridged String equality, and expose it for Foundation's use (#87271)
There's a longstanding problem in implementing `-isEqualToString:`,
where if you don't know how to get fast access to the other NSString's
contents, you have to pick between doing it character by character (very
slow), or calling [other isEqualToString: self], which risks infinite
recursion if the other string does the same.

This cuts the gordian knot by adding a new method
`isEqualToBytes:encoding:count:`, so you can get the contents out of
`self`, and hand it to the other string, confident that it will not need
to (nor, in fact be able to) ask you anything that might recurse.
2026-05-07 02:10:44 -07:00
Konrad `ktoso` Malawski 5610a52296 [Concurrency] Make TaskLocal.get inlinable (#88334) 2026-04-10 07:40:07 +09:00
Dario Rexin 7a6b8e4313 Merge pull request #87887 from drexin/wip-task-group-perf
[Concurrency] Improve performance of task groups
2026-03-17 00:38:51 -07:00
Dario Rexin e19c33affd [Concurrency] Improve performance of task groups
rdar://172192966

The tasks of a task group were stored in a singly linked list, causing a
linear scan for a task to find its predecessor, whenever a task completed
and had to be removed from the list. This change turns it into a doubly
linked list, so the linear scan is avoided completely.
2026-03-16 13:47:17 -07:00
Meghana Gupta 50f7a3cc86 Merge pull request #87813 from meg-gupta/spanbmk
Add some simple Span and MutableSpan benchmarks
2026-03-16 10:07:57 -07:00
Meghana Gupta cc58a071f7 Add some simple Span and MutableSpan benchmarks 2026-03-11 22:16:31 -07:00
Konrad `ktoso` Malawski 900f6906cd [Concurrency] make enqueue forwarding chain inlinable (#87611)
The inlinable certainly wont hurt on these "forwarding" methods, though
I was not able to confirm a noticable difference at least using this
benchmark.

Since adding those is definitely good anyway, I didn't dig much further,
let's just add them.

Assisted by: claude to make the benchmark, manually verified all changes
ran benchmarks and checked results etc
2026-03-02 08:35:20 -08:00
Karoy Lorentey 747ec1282b Merge pull request #82439 from vanvoorden/dictionary-identical
[SE-0494][StdLib] Add `isTriviallyIdentical(to:)` Methods to Dictionary and Set
2025-12-17 13:56:05 -08:00
Rick van Voorden 048091d6f2 [stdlib] array identical
Co-Authored-By: Ben Rimmington <me@benrimmington.com>
2025-12-08 17:39:01 -08:00
Rick van Voorden 15c020272a [stdlib] dictionary identical 2025-12-08 16:47:37 -08:00
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 2ec19ecb46 Benchmarks: Skip long benchmarks in -Onone build 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
Alastair Houghton f2e48bd293 Merge pull request #76257 from AreaZR/e
Use instancetype for the benchmark and SwiftNativeNSObject
2024-11-14 14:18:00 +00: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
Artem Chikin 21d5a7dfda Revert "[cxx-interop] Fix check to include std::span"
This reverts commit 2b90ea3bda.
2024-09-10 10:18:29 -07:00
smonteiro2 2b90ea3bda [cxx-interop] Fix check to include std::span 2024-09-10 14:01:43 +01: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
Rose 7f2787e249 Use instancetype for the benchmark and SwiftNativeNSObject
This is more for consistency than anything else, really.
2024-09-04 13:07:04 -04:00
Alex Hoppen c3ded9a035 Revert "[cxx-interop] Create benchmarks for using std::span in Swift" 2024-09-03 18:03:54 -07:00
smonteiro2 796ccb7df0 [cxx-interop] Create benchmarks for using std::span in Swift
* swift-ci linux tests do not support std::span
2024-08-30 16:39:57 +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
cui fliter 127077b3aa chore: fix some comments
Signed-off-by: cui fliter <imcusg@gmail.com>
2024-03-05 17:23:22 +08: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
Max Desiatov 21a2b78801 stdlib/benchmark: add canImport(Musl) where needed (#67120)
This allows compiling stdlib and benchmarks when targeting musl instead of Glibc.
2023-07-05 19:55:08 +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
Egor Zhdan bd8cf0272c [cxx-interop] Remove manual std::vector conformance in the benchmark
`std::vector::const_iterator` is now automatically conformed to `UnsafeCxxRandomAccessIterator`, and `std::vector` is conformed to `CxxRandomAccessCollection`.

The manually added conformances are now redundant.
2023-01-06 14:10:12 +00:00