Skip to content
New issue

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

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

Already on GitHub? # to your account

Stage 3 Checklist #336

Open
11 of 25 tasks
rricard opened this issue Jul 25, 2022 · 9 comments
Open
11 of 25 tasks

Stage 3 Checklist #336

rricard opened this issue Jul 25, 2022 · 9 comments
Milestone

Comments

@rricard
Copy link
Member

rricard commented Jul 25, 2022

Action Items


Thank you all for the feedback in the previous plenary, I hope I listed all outstanding items so far. Special thanks to @ljharb & @rkirsling to have volunteered as reviewers.

@rkirsling
Copy link
Member

rkirsling commented Aug 10, 2022

Opened #345. 🙂

@ljharb
Copy link
Member

ljharb commented Aug 11, 2022

Opened #349.

@lin72h
Copy link

lin72h commented Jan 13, 2023

Any update on this?

@acutmore
Copy link
Collaborator

Hi @lin72h here are the notes and slides for R&T from the last TC39 plenary (Nov 2022). One of the current concerns is from implementers on the technical challenges of implementing and supporting R&T, and a request to explore if there are ways to reduce the implementation cost while meeting the same core goals.

@lin72h
Copy link

lin72h commented Jan 13, 2023

Thanks for the links. Really looking forward for R&T coming in 2023

@bionicles
Copy link

bionicles commented Feb 12, 2025

May we have an update on this?

Anecdote: In Rust yesterday, I replaced a mutable vector type Vec<T> with an immutable slice Arc<[T]> and observed a 71% speedup to a hot path, got me thinking about this proposal again.

I believe this speedup may due to the ability to do reference counting rather than copy underlying data, better handle bounds checking if bounds are static, reduce memory allocation, and cache or otherwise accelerate things like equivalence checks and hashes.

Given Records and Tuples could yield big performance benefits for popular frameworks like React, Vue, Svelte, and Angular for similar reasons, do you think performance opportunities could warrant reconsideration of the cost:benefit analysis for this proposal? Seems promising and I hate to see it languish!

@acutmore
Copy link
Collaborator

Hi @bionicles. I've posted an update in #393.

I replaced a mutable vector type Vec with an immutable slice Arc<[T]> and observed a 71% speedup to a hot path, got me thinking about this proposal again.

I do not expect this performance gain to be applicable with JavaScript. Arrays are already pass by reference, so are not being implicitly copied and if code is currently spreading them like: ...arr then this work will almost certainly still happen if the code switched to using tuples. I do think there will be performance improvements opportunities for code that is currently creating defensive copies of values, they could check if the value is already a R/T and avoid creating a copy - but this wouldn't happen "out of the box" - could would need to be written in a way to gain this advantage.

@ljharb
Copy link
Member

ljharb commented Feb 24, 2025

(Nothing in JS is passed by reference; everything including objects is passed by value https://web.archive.org/web/20161005155047/http://www.jon-carlos.com/2013/is-javascript-call-by-value-or-call-by-reference/ )

@acutmore
Copy link
Collaborator

Sure, though the value being copied is a reference.
I usually avoid saying "pass by ref/val" and should have continued to do so as I find the mental model doesn't communicate universally well.

@acutmore acutmore unpinned this issue Feb 25, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants