Skip to content

[Foundation] Reorder _DataStorage to save 14 bytes of overhead #14989

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

Closed
wants to merge 1 commit into from

Conversation

phausler
Copy link
Contributor

@phausler phausler commented Mar 5, 2018

The backing storage for Data (_DataStorage) previously would require an allocation size of 72 bytes for the overs, however re-ordering the members to a more compact layout can easily yield considerably less. We can shave off 14 bytes and hit a mark of 58 bytes per storage for the ivars; which can easily fit into a smaller bucket size (not accounting for the class information).

This resolves the following issues:
rdar://problem/38150740

@phausler
Copy link
Contributor Author

phausler commented Mar 5, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 5, 2018

Build failed
Swift Test OS X Platform
Git Sha - aae9601

@phausler
Copy link
Contributor Author

phausler commented Mar 5, 2018

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 6, 2018

Build failed
Swift Test Linux Platform
Git Sha - aae9601

@phausler
Copy link
Contributor Author

phausler commented Mar 6, 2018

@swift-ci please test Linux

@swift-ci
Copy link
Contributor

swift-ci commented Mar 6, 2018

Build failed
Swift Test OS X Platform
Git Sha - aae9601

@phausler
Copy link
Contributor Author

phausler commented Mar 6, 2018

The failure listed has nothing to do with Data itself from what I can tell.

@jrose-apple
Copy link
Contributor

I hit it too. @aciidb0mb3r, know what's up with llbuild?

@aciidgh
Copy link
Contributor

aciidgh commented Mar 6, 2018

Dunno, this seems new. /cc @ddunbar

@jrose-apple
Copy link
Contributor

We've been messing with the driver, so it could be our side too. Weird that it's not hitting the regular builders, though.

@aciidgh
Copy link
Contributor

aciidgh commented Mar 6, 2018

I did change llbuild to build in release mode, maybe that is somehow related.

@ddunbar
Copy link
Contributor

ddunbar commented Mar 6, 2018

@Aciid maybe related to change to build in release mode? Should we revert?

@jrose-apple
Copy link
Contributor

Ah, yes, that would do it. You turned on -O and -wmo but didn't pass -num-threads, so it assumed you wanted a single object file in the current directory instead of respecting the output file map. And I believe we can't warn about this because Xcode always provides the same output file map for both WMO and non-WMO builds.

@aciidgh
Copy link
Contributor

aciidgh commented Mar 6, 2018

Reproduces locally if I try to build bindings. Reverting..

@aciidgh
Copy link
Contributor

aciidgh commented Mar 6, 2018

Raised this to disable release mode when building bindings swiftlang/swift-llbuild#233

@phausler
Copy link
Contributor Author

phausler commented Mar 6, 2018

Thanks for the help hunting down this failure.

@swift-ci please smoke test

@phausler
Copy link
Contributor Author

phausler commented Mar 6, 2018

@swift-ci please smoke test macOS

2 similar comments
@parkera
Copy link
Contributor

parkera commented Mar 13, 2018

@swift-ci please smoke test macOS

@phausler
Copy link
Contributor Author

@swift-ci please smoke test macOS

@phausler
Copy link
Contributor Author

@shahmishal do you know what is going on here? it does not seem to be responding to me. this has been outstanding for a long while and id like to eventually get this landed.

@jrose-apple
Copy link
Contributor

It smoke tested successfully. It's the full test that hasn't updated (and won't), but that's not strictly blocking you from merging.

@CodaFi
Copy link
Contributor

CodaFi commented Nov 18, 2019

Superseded by #28327

@CodaFi CodaFi closed this Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants