Egor Zhdan
d5f5d4bd55
[cxx-interop] Make CxxConvertibleToCollection.forEach public
...
This allows clients to iterate over a C++ container which doesn't provide random access with a `.forEach` call.
rdar://107995558
2023-04-18 14:43:43 +01:00
Egor Zhdan
34c2b0e50d
[cxx-interop] Make String.init(std.string) unlabeled
...
`Swift.String` can be initialized from any other type with an unlabeled initializer, which is either going to use the `CustomStringConvertible` conformance, or reflection. We would like clients to use the most suitable initializer, which is the one that takes `std.string` as a parameter. For instance, that allows us to attach a doc comment to the initializer.
This change makes the initializer unlabeled to make sure it is chosed by overload resolution when a client invokes `String(myCxxString)`.
2023-02-02 12:47:08 +00: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
3fa1952abc
Fix warning in benchmark
...
warning: immutable value 'i' was never used; consider replacing with '_' or removing it
for i in 0...N {
^
2023-01-18 21:21:04 +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
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
Alex Lorenz
029ec7abe9
[interop] cxx vector benchmark - reenable it only outside SwiftPM to workaround module serialization issue
2022-10-20 16:13:44 -07:00
Alex Lorenz
e159b1d282
[interop][benchmark] disable CxxVectorSum benchmarks for now until SwiftPM build issue is resolved
2022-10-14 17:08:48 -07:00
Alex Lorenz
b701124b4c
[interop] CxxVectorSum benchmark: workaround https://github.com/apple/swift/issues/61472
2022-10-14 14:39:37 -07:00
Alex Lorenz
c4a9136731
[interop] benchmark - disable linux until https://github.com/apple/swift/issues/61547 is fixed
2022-10-11 12:26:28 -07:00
Alex Lorenz
5b88dc3a8c
[interop] benchmark - add a comment to bump up the iteration count
2022-10-10 16:39:17 -07:00
Alex Lorenz
d50f834d78
[interop] vec benchmark - update benchmark naming
2022-10-10 11:39:58 -07:00
Alex Lorenz
3341aef305
[interop] cxx vec benchmark - bump up the iter repeat count
2022-10-10 11:06:30 -07:00
Alex Lorenz
a50939b07e
[interop] cxx vec benchmark - initialize vector before benchmark
2022-10-10 11:06:10 -07:00
Alex Lorenz
0e95c759e5
[interop] cxx vector benchmark: do not use subscript until https://github.com/apple/swift/issues/61499 is fixed
2022-10-10 09:14:40 -07:00
Alex Lorenz
ca927dc295
[interop] cxx vector benchmark: iterator is fast with operator == in C++, and subscript is fast with https://github.com/apple/swift/issues/61499 fixed
2022-10-10 09:14:40 -07:00
Alex Lorenz
46342302ff
[interop] cxx vector sum benchmark - reduce iterations to avoid long times for slow runs
2022-10-10 09:14:40 -07:00
Alex Lorenz
2a07c1c8ce
[interop] benchmark: add run_CxxVectorOfU32_Sum_Swift_RawIteratorLoop that doesn't use C++ inline helpers
2022-10-10 09:13:32 -07:00
Alex Lorenz
157be05c97
[interop] rewrite the C++ vector sum benchmark to have clear naming and take iter into account
2022-10-10 09:13:31 -07: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
Alex Lorenz
e659a52f46
[interop] mark C++ benchmarks with cxxInterop tag for easy local testing
2022-10-03 17:13:10 -07:00
Egor Zhdan
626eadcf64
[cxx-interop] Import size_t as Int instead of UInt on Linux
...
When using libc++, Swift imports `size_t` as Int despite `size_t` being an unsigned type. This is intentional & is specified in `lib/ClangImporter/MappedTypes.def`. Previously, MappedTypes were only honored for C/C++ types declared on the file level.
In libstdc++, `size_t` is declared within `namespace std` and not on the file level, so the mapping to Int was not applied.
This change ensures that MappedTypes are also applied to types declared in `namespace std`.
2022-03-24 15:29:19 +00: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
Karoy Lorentey
8910b75cfe
[benchmark] Stop capitalizing function and variable names
2021-09-15 22:08:07 -07: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