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

Should this proposal instead follow proposed Immutable ArrayBuffer pattern? #10

Open
erights opened this issue Dec 23, 2024 · 0 comments

Comments

@erights
Copy link
Collaborator

erights commented Dec 23, 2024

The current state of this proposal would have .snapshot() of a mutable collection make an immutable copy. Without special implementation tricks(*), this would be expensive.

By contrast, https://github.com/tc39/proposal-immutable-arraybuffer has a zero-copy .toImmutable(), that "detaches" the data from the original collection, so the creation of the derived immutable collection is zero-copy without special implementation tricks.

(*) such as copy-on-write. At least for ArrayBuffers (including proposed Immutable ArrayBuffers) some implementations have expressed strong reluctance to implement such tricks. However, we don't yet know whether this reluctance would apply to other collections.

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

No branches or pull requests

1 participant