Skip to content

[cxx-interop] Make Cxx and CxxStdlib libraries resilient #77559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

egorzhdan
Copy link
Contributor

This enables library evolution for the two libraries that form the Swift overlay for the C++ standard library.

rdar://129169673

This enables library evolution for the two libraries that form the Swift overlay for the C++ standard library.

rdar://129169673
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Nov 12, 2024
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@egorzhdan
Copy link
Contributor Author

@swift-ci please benchmark

Copy link
Contributor

@Xazax-hun Xazax-hun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Linux

@egorzhdan
Copy link
Contributor Author

Performance (x86_64): -O

Regression OLD NEW DELTA RATIO
Array.removeAll.keepingCapacity.Object 5.995 7.483 +24.8% 0.80x (?)
CharacterLiteralsLarge 54.45 58.821 +8.0% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
Dictionary4 281.714 209.667 -25.6% 1.34x (?)
Dictionary4OfObjects 309.25 230.667 -25.4% 1.34x (?)
FlattenListFlatMap 4419.0 3893.0 -11.9% 1.14x (?)
ArrayInClass 196.083 174.296 -11.1% 1.12x (?)
DistinctClassFieldAccesses 37.448 33.899 -9.5% 1.10x (?)
ArraySetElement 296.0 271.286 -8.3% 1.09x (?)
PrefixWhileSequence 194.0 180.667 -6.9% 1.07x (?)

Code size: -O

Regression OLD NEW DELTA RATIO
CxxVectorSum.o 18128 18496 +2.0% 0.98x
CxxSpanTests.o 15634 15810 +1.1% 0.99x

Performance (x86_64): -Osize

Regression OLD NEW DELTA RATIO
CxxSpanTests.map 377.4 535.667 +41.9% 0.70x (?)
Array.removeAll.keepingCapacity.Object 5.981 7.197 +20.3% 0.83x (?)
ObjectiveCBridgeStubDateAccess 130.733 152.538 +16.7% 0.86x (?)
Data.hash.Empty 52.261 58.789 +12.5% 0.89x (?)
CxxSpanTests.filter 522.75 585.667 +12.0% 0.89x (?)
FlattenListFlatMap 3631.0 3996.0 +10.1% 0.91x (?)
 
Improvement OLD NEW DELTA RATIO
Dictionary4 208.75 163.556 -21.6% 1.28x (?)
CxxSpanTests.reduce 195.667 165.636 -15.3% 1.18x (?)
CxxSpanTests.for.loop 195.571 170.1 -13.0% 1.15x (?)
StrComplexWalk 3403.333 3004.286 -11.7% 1.13x (?)
Dictionary4OfObjects 239.0 218.429 -8.6% 1.09x (?)

Code size: -Osize

Regression OLD NEW DELTA RATIO
CxxVectorSum.o 16529 16913 +2.3% 0.98x
CxxSpanTests.o 13778 14089 +2.3% 0.98x

Performance (x86_64): -Onone

Improvement OLD NEW DELTA RATIO
PointerArithmetics 56633.333 50175.0 -11.4% 1.13x (?)
ObjectiveCBridgeStubNSDateRefAccess 4311.0 3972.0 -7.9% 1.09x (?)
ArrayAppendGenericStructs 1240.0 1145.0 -7.7% 1.08x (?)
DataSubscriptMedium 63.167 58.882 -6.8% 1.07x (?)

Code size: -swiftlibs

@egorzhdan
Copy link
Contributor Author

The benchmarks seem to be noisy. The only performance regressions are in CxxSpanTests.map and CxxSpanTests.filter. We can provide overloads CxxConvertibleToCollection.map and CxxConvertibleToCollection.filter to mitigate that.

@egorzhdan egorzhdan merged commit c20a2bf into main Nov 13, 2024
6 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/cxxstdlib-resilient branch November 13, 2024 16:45
egorzhdan added a commit to swiftlang/swift-installer-scripts that referenced this pull request Nov 13, 2024
These two libraries are now built with library evolution enabled.

See swiftlang/swift#77559
@hjyamauchi
Copy link
Contributor

@egorzhdan it seems like this PR/commit may be related to the linker issue I'm seeing: #77756 WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants