-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Refactor PropertyDescriptor
#794
Conversation
Codecov Report
@@ Coverage Diff @@
## master #794 +/- ##
==========================================
- Coverage 59.68% 59.54% -0.15%
==========================================
Files 157 157
Lines 10054 10034 -20
==========================================
- Hits 6001 5975 -26
- Misses 4053 4059 +6
Continue to review full report at Codecov.
|
Benchmark for be7d439Click to view benchmark
|
Benchmark for f713b54Click to view benchmark
|
d9455d4
to
634d624
Compare
Benchmark for 719e34fClick to view benchmark
|
Benchmark for 7ce1a65Click to view benchmark
|
Benchmark for b0b3f3fClick to view benchmark
|
Some benchmarks show a 20% increase in performance :) |
You're leaving a lot of |
My intention with this PR was not to fix the already present bugs (even though I did fix some), but to make them more visible, places where there were hard to identify bugs (like accessor not being called, properties being ignored when they shouldn't) now panic (with unwrap/expect) so its easier to know were there located, and are immediately known as bugs, instead of giving some weird behaviour.
Will create the issue once this has been merged :) |
Benchmark for fa3799aClick 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.
I love the new benchmarks. Check the comment by @RageKnify and see if a re-base fixes the tests, but for me it's good to go (also, I'm not super familiar with this, so take my review with a gran of salt) :)
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.
Other than the allocation everything seems alright, I'd already reviwed everything yesterday and the last 2 commit
s didn't change all that much.
- Add DataDescriptor - Add AccessorDescriptor - Remove PropertyDescriptor::data_descriptor() - Make AccessorDescriptor accessors GcObjects - Make Object::get_own_property return a Option<PropertyDescriptor> - Remove PropertyDescriptor::is_none() - Remove PropertyDescriptor::empty() - Removed PropertyDescriptor::value() - Added spec complaint ToPropertyDescriptor (to_property_descriptor) - Remove From<&PropertyDescriptor> for Value
3ac48f3
to
760e0f4
Compare
Benchmark for 023fcdbClick to view benchmark
|
This PR adds a nice API for creating Property Descriptor (
DataDescriptor
andAccessorDescriptor
) by making illegal state unrepresentable, for exampleget
andvalue
in the same property descriptor (which is not allowed, but was possible with the old implementation), which we needed dynamic checks to prove that it was not the case (performance penalty), but now we leverage the Type System for this as well as it makes implementing #591 and accessors so much easier.It changes the following:
Property
=>PropertyDescriptor
DataDescriptor
for defining data descriptorsAccessorDescriptor
for defining accessor descriptorsPropertyDescriptor
an enumHAS_*
formAttribute
Value::update_property
related to DecoupleObject
fromValue
#577