Commit Graph

1633 Commits

Author SHA1 Message Date
David Smith
5b726bc5b3 [6.2] Improve memoization of conformance lookups during casting (#82746) 2025-07-07 10:53:57 -07:00
David Smith
f8c1df8e09 [6.2] Native implementation of -lengthOfBytesUsingEncoding (#82747) 2025-07-03 05:08:37 -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
Alex Hoppen
c3ded9a035 Revert "[cxx-interop] Create benchmarks for using std::span in Swift" 2024-09-03 18:03:54 -07:00
Susana Monteiro
c7e33f1068 Merge pull request #76207 from swiftlang/susmonteiro/cxx-span-benchmarks
[cxx-interop] pass `-std=c++20` to configurations using `std::span`
2024-09-03 10:19:07 +01:00
smonteiro2
282b1ba942 [cxx-interop] pass -std=c++20 to configurations using std::span
When the benchmarks are built with SwiftPM, the -std=c++20 flag is passed if the -cxx-interoperability-mode is present. This patch switches from -Xfrontend -enable-experimental-cxx-interop to the required interoperability flag.
2024-09-02 18:53:31 +01: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
Ben Langmuir
ad82d86041 Bump the deployment target for the compiler to macOS 13.0
Bump the deployment target from macOS 10.13-aligned versions to macOS
13.0-aligned versions. This allows us to stop linking CoreFoundation
in the swift runtime, which was previously required for availability
checking. It also lets us align the deployment target on x86_64 with
arm64, which was 11.0. Finally, it is a prerequisite to being able to
build swift using the macOS 15 beta SDKs.
2024-08-29 14:30:09 -07:00
Erik Eckstein
2960f472a7 fix the swift library code size comparison in the run_smoke_bench script
In some configurations the script mixed up the build architectures and accidentally reported the code size difference between the x86 and arm.
2024-08-05 11:03:24 +02:00
Egor Zhdan
7bdd9dd84a [cxx-interop] Enable benchmarks in SwiftPM mode
The C++ interop benchmarks were only running when building with CMake, not with SwiftPM, because of a bug that was only triggering with SwiftPM. That bug seems to be fixed now.
2024-07-24 13:38:38 +01:00
Egor Zhdan
f1ca417da6 [cxx-interop] Run benchmarks in C++20 mode
This will allow benchmarking Swift access to `std::span` which is a C++20 feature and therefore requires compiling with `-Xcc -std=c++20`.
2024-07-23 12:30:17 +01:00
Egor Zhdan
cb2bd5aeaf Merge pull request #75373 from swiftlang/egorzhdan/reenable-benchmarks
[cxx-interop] Re-enable benchmarks
2024-07-19 20:27:18 +01:00
Egor Zhdan
0bfd5722d4 [cxx-interop] Re-enable benchmarks
This adds an `import CxxStdlib` statement which fixes compilation. It should be redundant, but it works around a bug that got exposed by an change in explicit modules (rdar://128520766).

This will bring back the performance numbers while the underlying issue is being investigated.
2024-07-19 17:15:46 +01:00
David Smith
a861fc117b Add benchmarks for withContiguousStorageIfAvailable on bridged NSArrays (#75215) 2024-07-16 00:24:23 -07:00
Alexander Cyon
cb55dbbb96 Fix typo 'defne' -> 'define'. 2024-07-07 18:22:14 +02:00
Alexander Cyon
9d04bfd848 [benchmark] Fix typos 2024-07-06 13:17:13 +02:00
Karoy Lorentey
ad3d3ad045 [benchmark] Update/fix availability checks 2024-06-13 18:00:45 -07:00
David Smith
5b81405a75 Add new benchmarks for UTF16 transcoding (#74229) 2024-06-08 15:21:22 -07: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
eeckstein
d1ec089c72 Merge pull request #72088 from language-core/main
chore: fix some comments
2024-03-06 10:08:50 +01:00
Guillaume Lessard
3aea3a0842 Merge pull request #71867 from oscbyspro/better-create-benchmark-script
Some create_benchmark.py script enhancements.
2024-03-05 12:16:25 -08: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
bd2abc6cde Some create_benchmark.py script enhancements (v3).
This patch is held at linterpoint. Here's the ransom.
2024-02-25 11:22:51 +01:00
Guillaume Lessard
7ed54c903c Merge pull request #71786 from oscbyspro/better-joined-distance-from-to-benchmarks
FlattenSequence/distance(from:to:) benchmarks.
2024-02-24 16:59:25 -08:00
Oscar Byström Ericsson
783a9c6a77 Some create_benchmark.py script enhancements (v2). 2024-02-24 10:40:06 +01:00