Skip to content
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

Remove storage indirection for FileSystemError #2726

Merged
merged 1 commit into from
May 23, 2024
Merged

Conversation

glbrntt
Copy link
Contributor

@glbrntt glbrntt commented May 23, 2024

Motivation:

Existentials are boxed if they are wider than 24 bytes. A number of value types in NIO are implemented with storage classes so that the alloaction is only paid for once. However, existential errors are treated differently, they are unconditionally boxed. Implementing errors with storage classes therefore introduces an unnecessary allocation.

Modifications:

  • Remove the storage class for FileSystemError
  • Remove the copy-on-write test

Result:

Fewer allocations

Motivation:

Existentials are boxed if they are wider than 24 bytes. A number of
value types in NIO are implemented with storage classes so that the
alloaction is only paid for once. However, existential errors are
treated differently, they are unconditionally boxed. Implementing errors
with storage classes therefore introduces an unnecessary allocation.

Modifications:

- Remove the storage class for FileSystemError
- Remove the copy-on-write test

Result:

Fewer allocations
@glbrntt glbrntt added the patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1) label May 23, 2024
@glbrntt glbrntt requested a review from gjcairo May 23, 2024 10:13
@glbrntt glbrntt merged commit 4612941 into apple:main May 23, 2024
8 of 9 checks passed
@glbrntt glbrntt deleted the fs-error branch May 23, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch-version-bump-only For PRs that when merged will only cause a bump of the patch version, ie. 1.0.x -> 1.0.(x+1)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants