-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Index PropertyKey
, Object
iterators and symbol support
#603
Conversation
Codecov Report
@@ Coverage Diff @@
## master #603 +/- ##
==========================================
- Coverage 72.91% 72.49% -0.43%
==========================================
Files 178 179 +1
Lines 13226 13367 +141
==========================================
+ Hits 9644 9690 +46
- Misses 3582 3677 +95
Continue to review full report at Codecov.
|
Benchmark for cd40d51Click to view benchmark
|
Benchmark for b133ed9Click to view benchmark
|
Benchmark for 2db92d8Click to view benchmark
|
Benchmark for f81486dClick to view benchmark
|
Benchmark for 6f191f3Click to view benchmark
|
Benchmark for 8b5a0a6Click to view benchmark
|
Benchmark for 68ef7feClick to view benchmark
|
Benchmark for 3bae8e1Click to view benchmark
|
Benchmark for 57fbec8Click to view benchmark
|
Benchmark for 4cbfc08Click to view benchmark
|
PropertyKey
and Object
iteratorsPropertyKey
, Object
iterators and symbol support
Benchmark for 0a85013Click to view benchmark
|
Benchmark for 382a3a0Click to view benchmark
|
36f1321
to
7f054cb
Compare
Benchmark for 2eb34c2Click to view benchmark
|
Benchmark for 1a96533Click to view benchmark
|
Benchmark for 720ecd7Click to view benchmark
|
7d64602
to
548b295
Compare
Benchmark for daea89bClick to view benchmark
|
Benchmark for 591096bClick to view benchmark
|
Benchmark for 591096bClick to view benchmark
|
This is ready for review! :) Hmmm. The benchmarks are not showing the correct results! I did a local benchmark and there was a very small regression in 3 benchmarks (+5%) that is because we did not account for Symbols at all before. but the majority have a What do you think? @Razican |
Thanks! I will give this a look as soon as I can :)
Yep, we have to take the benchmarks with a grain of salt. I would say that if multiple benchmarks are showing the same, (which might be the case here), it might be because this is regressing in the particular case of the GitHub actions instance configuration. I will run the benchmarks locally just to make sure that there isn't something we are missing. In any case, I think it's fine to have some performance regressions when we add new stuff. I expect some performance regressions when we implement things such as async/await. |
ff818d4
to
8d16b21
Compare
Benchmark for 7adeeddClick to view benchmark
|
8d16b21
to
41d347f
Compare
Benchmark for 4d21eb2Click to view benchmark
|
41d347f
to
e821d8f
Compare
Benchmark for 3d77573Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, thanks! I finally had time to do a proper review of the whole code, and found some things that could be improved, or that need a bit of explanation (to me).
Benchmark for 5616890Click to view benchmark
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's merge!
It changes the following:
iter
method to object to iterate over all (indexed, string and symbol) keys (PropertyKey
) and value (Property
)keys
method to object to iterate over all (indexed, string and symbol) keys (PropertyKey
)values
method to object to iterate through all the (indexed, string and symbol) values (Property
).symbol_properties
method to object to iterate over symbol keys (RcSymbol
) and value (Property
)symbol_property_keys
method to object to iterate over symbol keys (RcSymbol
)symbol_property_values
method to object to iterate over symbol values (Property
)index_properties
method to object to iterate over index keys (u32
) and value (Property
)index_property_keys
method to object to iterate over index keys (u32
)index_property_values
method to object to iterate over index values (Property
)string_properties
method to object to iterate over string keys (RcString
) and value (Property
)string_property_keys
method to object to iterate over string keys (RcString
)string_property_values
method to object to iterate over string values (Property
)properties
,properties_mut
,symbol_properties
andsymbol_properties_mut
.Symbol
indexing support..construct_symbol()
for creating symbols.construct_object()
for creating object with the prototype set.PropertyKey::Index(u32)
This is done for a couple of reasons:u32
and not asRcString
s (memory optimization)u32
instead ofRcString
s).get_field(i.to_string())
instead we should do.get_field(i)
indexed_properties
Hash map with keyu32
this is because an array index is from0
to2^32 - 1
(u32::MAX
).IndexMap
and when we need to iterate through all the elements (in order) we can do so without iteration through0
tolength
(this is what caused the test runner to freeze in Add ECMAScript test suite (test262) #567 withindexOf
with sparse elements). should make iteration very fast.RcString
.Object
symbol_properties
contain keyRcSymbol
instead of just hash:Symbol
description
we need the symbol:Symbol.toPrimitive.description