Uh oh!
There was an error while loading. Please reload this page.
Backport bugfixes, infrastructural changes and perf improvements from the polymorphism feature branch - #54420
Conversation
* Use array instead of list for storing frames. Previous frames can now be passed by reference * Ensure that the _count field always reflects the current depth. * Remove StackFrame.Reset() methods which are occassionally a source of dirty frames being reused.
ghost
commented
Jun 18, 2021
Tagging subscribers to this area: @eiriktsarpalis, @layomia Issue DetailsThis PR backports a selection of bugfixes, infrastructural changes and perf improvements that were made as part of the polymorphism feature branch in #53882. I have layered the changes into separate that should ideally be reviewed independently:
The changes should make it easier to incorporate the polymorphism infrastructural changes in the future. Overall the changes result in a slight increase in serialization performance, on average between 4-8% faster in our benchmark suite.
|
steveharter
left a comment
There was a problem hiding this comment.
Thanks for the refactoring. LGTM with a couple questions.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ghost
commented
Jun 18, 2021
Hello @eiriktsarpalis! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me ( |
This PR backports a selection of bugfixes, infrastructural changes and perf improvements that were made as part of the polymorphism feature branch in #53882. I have layered the changes into separate commits that should ideally be reviewed independently:
Push()andPop()operations that assist in early detection of stack-corrupting bugs.WriteStackandReadStackimplementations to_countfield always accurately reflects the current stack depth.StackFrame.Reset()methods and instead clearsCurrentby assigning it to adefaultinstance. This eliminates a class of bugs caused by dirty frames being reused in new contexts.typeof(T).IsValueTypeexpressions Optimize typeof(T).IsValueType #1157) in the serialization hot path methods.The changes should make it easier to incorporate the polymorphism infrastructural changes in the future. Overall the changes result in a slight increase in serialization performance, on average between 4-8% faster in our benchmark suite.