Open
Conversation
42c728d to
b8a98d4
Compare
b8a98d4 to
7f3a87f
Compare
Contributor
Author
|
@swift-ci please test |
1 similar comment
Contributor
Author
|
@swift-ci please test |
812f0e9 to
b82b93b
Compare
Contributor
Author
|
@swift-ci please test |
b82b93b to
e7d7c59
Compare
Contributor
Author
|
@swift-ci please test |
Contributor
Author
|
Full toolchain tests have passed against this change via cross repo testing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new ABI representation of
Datathat is streamlined to reduce client code size and improve average runtime performance.Motivation:
Data's representation today (a combination of 4 possible representations: empty, inline, small, and large) suffers from significant code size and runtime performance issues due to generic handling of possible representations. A single, streamlined representation reduces the code size and runtime requirements to read/write the bytes.Modifications:
A new
DATA_LEGACY_ABIbuild flag is added to build the existing ABI representation (required to maintain on ABI stable platforms like macOS). When this flag is not provided, a new representation (not ABI compatible with the existing representation) is built and used instead.Result:
On non-ABI stable platforms (Linux, Windows, WASM, Android, etc.), benchmarking shows the following throughput performance changes:
==(equal inputs)!=(unequal inputs).count.bytes.append(UInt8).insert(_:at:)*Iteration of a large slice took long enough that the benchmarking suite was not able to measure its throughput
Overall, most operations see a significant performance improvement (including
.byteswhich we expect to be a very common operation sees up to a 1300% performance improvement). There are a few cases which have regressed, mostly in the line data case but given that inlineDatas are limited to 14 bytes and many of the inline operations also improved, I expect that these performance regressions are likely worth the tradeoff.Testing:
Existing unit test coverage applies to the new representation.