Commit Graph

1659 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
0730b91205 Merge pull request #84401 from slavapestov/one-more-monoid-benchmark-fix
Fix a slightly non-deterministic behavior in the Monoids benchmark
2025-09-19 22:34:57 -04:00
Slava Pestov
575c7097f6 Fix a slightly non-deterministic behavior in the Monoids benchmark
When built with output enabled, sometimes a few lines would be
interchanged, depending on the order in which parallel tasks
complete. Simplify the dispatcher logic a bit to ensure we get
the same output ordering every time.

This does not impact the running time of the benchmark.
2025-09-19 17:07:10 -04:00
Nate Cook
80f052e251 [stdlib] Switch to a linear-space variant of Myers diffing (#83212)
This changes the implementation for `Collection.difference(from:)` to
use a linear-space complexity variation of the same Myers algorithm. The
new version is similar in execution time to the existing one, but should
alleviate memory pressure when diffing collections where the number of
differences approaches the size of the collection. While the new
algorithm returns a set of changes that is the same size as the previous
version, the specific changes are not guaranteed to be the same.

rdar://155829876
2025-09-19 10:03:26 -07:00
Slava Pestov
d7864301b6 Benchmarks: Remove DispatchSemaphore hack from Monoids benchmark 2025-08-27 10:37:10 -04: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
Nate Cook
a14dbd2fd0 Add and enable another large diffing benchmark (#83832)
Enabling both of these despite the long runtime so that I can get an
accurate measure of the change with the new diffing implementation.
After #83212 is merged I will disable these large benchmarks again.
2025-08-21 09:23:29 -05:00
Slava Pestov
4d7adea1e2 One final round of small cleanups for Monoids benchmark 2025-08-18 17:35:31 -04:00
Erik Eckstein
ce86f65272 benchmark script tests: make the match string for invalid option errors more flexible
Because the actual output depends on the python version
2025-07-25 15:21:49 +02:00
Slava Pestov
68b044abb8 Benchmarks: Set deployment target to Swift 5.5-era Apple OSes
We can probably bump this further, but at the very least this allows
the use of basic concurrency features.
2025-07-23 17:26:49 -04:00
Slava Pestov
56f6c09afd Benchmarks: Fix multi-source benchmarks
The swiftpm build was broken and it only worked if there was exactly
one multi-source benchmark. Use the correct subdirectory for each one.
2025-07-23 17:26:48 -04:00
Slava Pestov
e6b77812ef New "Monoids" benchmark 2025-07-23 17:26:48 -04:00
Nate Cook
a390f026b9 Add a diffing benchmark with large inputs (#83248) 2025-07-23 10:54:29 -07:00
eeckstein
22536978c2 Merge pull request #82600 from valeriyvan/WarningObjectiveCBridging
Fix unused var warning in benchmark
2025-07-01 22:49:18 +02:00
eeckstein
a3c49524a8 Merge pull request #82599 from valeriyvan/WarningDiffingMyers
Fix warning in benchmark: generic parameter 'C' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
2025-07-01 13:44:36 +02:00
Valeriy Van
b0f46de8b1 Fix unused var warning in benchmark 2025-06-28 17:48:46 +03:00
Valeriy Van
568364cd88 Fix warning
warning: generic parameter 'C' shadows generic parameter from outer scope with the same name; this is an error in the Swift 6 language mode
2025-06-28 17:45:16 +03:00
David Smith
1a56da655f Native implementation of -lengthOfBytesUsingEncoding, plus handling ASCII-subset MacRoman in a few places (#81791)
Fixes rdar://154341146
2025-06-27 13:48:10 -07: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
Stephen Canon
76df55d1aa Quiet a deprecation warning in the count(where:) benchmark (#82257)
I think the benchmarking machinery moved while count(where:) was in
limbo, so this was deprecated before the benchmark actually landed.
2025-06-17 08:58:34 -04:00
Ian Anderson
15345ef2d5 [CMake][Darwin] Remove support for building the SDK overlays on Apple platforms
The SDK overlays have been provided in the Apple SDKs for many years, and the interface and implementation has diverged in more recent years such that trying to build the Swift version no longer works. Remove all of the dead code.

rdar://151889154
2025-05-23 23:38:08 -07:00
David Smith
e795eb0d13 Cache the last ObjC bridging conformance we looked up (#81545)
Fixes rdar://151475392
2025-05-16 11:00:13 -07:00
John Hui
ff596d5932 Revert "[cxx-interop] Temporarily exclude CxxSetToCollection benchmark from the build (#81145)"
This reverts commit 86c30d6b58.
2025-04-30 18:36:57 -07:00
Egor Zhdan
86c30d6b58 [cxx-interop] Temporarily exclude CxxSetToCollection benchmark from the build (#81145)
This is needed to unblock nightly toolchains, which are currently failing to build with an assertion:
```
swift-frontend: /home/build-user/build/buildbot_linux/llvm-linux-x86_64/tools/clang/include/clang/AST/TypeNodes.inc:79: TypeInfo clang::ASTContext::getTypeInfoImpl(const Type *) const: Assertion `!T->isDependentType() && "should not see dependent types here"' failed.
```

rdar://150067288
2025-04-29 09:57:39 -07:00
Meghana Gupta
ec97a16281 Disable C++ interop benchmarks 2025-04-22 11:25:02 -07:00
Roman Temchenko
277518293e Merge pull request #79528 from iThinker/improve-benchmark-readme
Update benchmark README with info on how to ensure benchmarks test locally built stdlib
2025-02-24 19:01:44 -08: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
Egor Zhdan
9f3dad4096 [cxx-interop] Workaround a compiler crash on Ubuntu 22.04
Swift is crashing on Ubuntu 22.04 when compiling benchmarks for `std::span`.

rdar://136875225
2024-10-04 17:26:00 +01:00
Egor Zhdan
0005b95ed6 Merge pull request #76782 from swiftlang/egorzhdan/benchmark-bump-size
[cxx-interop] Increase the size of `std::string`s in benchmarks
2024-10-02 17:29:45 +01:00
Egor Zhdan
e6e5524fb1 [cxx-interop] Increase the size of std::strings in benchmarks
Since https://github.com/swiftlang/swift/pull/75608, the performance of `std::string` <=> `Swift.String` conversions improved significantly. To make sure the workload is significant enough for the benchmark results to be noise-free, this bumps the size of Swift strings that are being tested.
2024-10-01 13:24:35 +01:00
Egor Zhdan
3ff51016a6 [cxx-interop] Workaround a modularization issue in benchmarks
`import CxxStdlib` should not be required, since `CxxStdlibPerformance` transitively imports the C++ stdlib, but having the explicit import works around a modularization issue (rdar://128520766).

rdar://136330247
2024-09-27 19:32:01 +01:00
Egor Zhdan
9f44e0d56b [cxx-interop] Build benchmarks with modern C++ interop flag
To build benchmarks that use C++ `std::span`, we need to use C++20 standard.

SwiftPM supports `.interoperabilityMode(.Cxx)` build setting starting from version 5.9. In more recent versions, SwiftPM is also able to correctly propagate the C++ standard version (e.g. `-Xcc -std=c++20`) to the Swift compiler invocation, when C++ interop is enabled. The C++ standard version is only propagated if the modern build setting is used. This has caused Linux CI failures in the past.

This change switches the package manifest to use the modern build setting to enable C++ interop.
2024-09-18 14:07:35 +01:00
Susana Monteiro
108abc3ad3 Merge pull request #76447 from swiftlang/susmonteiro/cxx-span-benchmarks
[cxx-interop] Benchmarks for std::span in Swift
2024-09-18 12:22:22 +01: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
Ben Langmuir
46a83bea0c Roll back to watchOS 6.0 to keep armv7k support
While the swift compiler in Xcode links against tbd files in the sdk
that contain an armv7k slice, the open source swift toolchain links
against the stdlib dylb that is in the toolchain itself. This means that
we cannot drop support for armv7k support in the stdlib dylib without
losing support for building armv7k when back deploying to older watch
targets. For now, roll back the recent deployment target bump from 9.0
to 6.0 so that we keep armv7k and i386 simulator.

rdar://135560598
2024-09-13 08:49:09 -07:00
Ian Anderson
5bf2c937ab [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

rdar://115192929
2024-09-11 22:26:37 -07: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
Susana Monteiro
75f00fe345 Merge pull request #76370 from swiftlang/susmonteiro/cxx-span-benchmarks
[cxx-interop] Fix check to include std::span
2024-09-10 18:14:53 +01:00
smonteiro2
2b90ea3bda [cxx-interop] Fix check to include std::span 2024-09-10 14:01:43 +01:00
Artem Chikin
1baff87879 Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms" 2024-09-09 09:57:14 -07:00
Susana Monteiro
28ac942f41 Merge pull request #76245 from swiftlang/susmonteiro/cxx-span-benchmarks
[cxx-interop] Create benchmarks for using std::span in Swift
2024-09-09 16:34:01 +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
Ian Anderson
8959dd97fe [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

%target-swift-emit-pcm doesn't use the sdk, but %target-swift-frontend does, which will cause them to have a mismatch with "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers" aka LANGOPT(BuiltinHeadersInSystemModules) aka -fbuiltin-headers-in-system-modules.

rdar://115192929
2024-09-06 13:28:14 -07:00
Ben Langmuir
44b68cb5dc Merge pull request #75914 from benlangmuir/turn-it-up-to-11
Bump the deployment target for the compiler to macOS 13.0
2024-09-06 13:23:47 -07: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