You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+32-4Lines changed: 32 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -253,13 +253,28 @@ Accessing a member expression of a tuple or record via `.` or `[]` follows the s
253
253
254
254
An instance of `Record` has the same keys and values as the `record` value it was created from. These keys are all `writable: false, enumerable: true, configurable: false`.
255
255
256
-
An instance of `Tuple` has keys that are `${index}` for each index in the original `tuple`. The value for each of these keys is the corresponding value in the original `tuple`. These keys are all `writable: false, enumerable: true, configurable: false`. In addition, there is a non-enumerable `length` key. This behavior matches that of the `String` wrapper object. That is, `Object.getOwnPropertyDescriptors(Object(#["a", "b"]))` and `Object.getOwnPropertyDescriptors(new String("ab"))` each return an object that looks like this:
256
+
An instance of `Tuple` has keys that are `${index}` for each index in the original `tuple`. The value for each of these keys is the corresponding value in the original `tuple`. These keys are all `writable: false, enumerable: true, configurable: false`. In addition, there is a non-enumerable `length` key. This behavior matches that of the `String` wrapper object. That is, `Object.getOwnPropertyDescriptors(Object(#["a", "b"]))` and `Object.getOwnPropertyDescriptors(new String("ab"))` each return an object that looks like this:
## What are the performance expectations of those Data Structures?
390
+
391
+
This proposal in itself does not put any performance guarantees and does not require specific optimizations on the implementers. It is however built in a way that some performance optimizations can be done in most cases if implementers choose to do so.
392
+
393
+
The way the proposal is built can enable a few things (among other):
394
+
395
+
- Structural sharing can be used to represent those data structures internally. Structural sharing enables faster copy and comparison.
396
+
- This structural sharing can be partially derived from the existing shape system implemented in most engines
397
+
- Those structures can be built in a thread-safe way so they can be used across workers
398
+
- The web browser's structural cloning algorithm used to serialize data to a worker can be changed to only pass the thread safe structure across the boundary
399
+
400
+
Not all of those optimizations have to be done but the proposal and the way it's built should enable engines to eventually implement them more easily.
401
+
374
402
## Why #{}/#[] syntax? What about an existing or new keyword?
375
403
376
404
Using a keyword as a prefix to the standard object/array literal syntax presents issues around
0 commit comments