Skip to content

ARCH-6354: Optimize Get/SetFieldValue() to use integer indexes instead of search in Dictionary by string field name #158

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

Merged
merged 31 commits into from
Dec 20, 2023

Conversation

SergeiPavlov
Copy link
Collaborator

@SergeiPavlov SergeiPavlov commented Nov 14, 2023

The [Field] properties inside class are sorted in order of MetadataToken value.

Properties, inherited from base class are first.

@SergeiPavlov SergeiPavlov requested a review from botinko November 14, 2023 07:42
@botinko
Copy link

botinko commented Nov 14, 2023

@SergeiPavlov check failed tests, I saw Index was outside the bounds of the array.

Copy link

@botinko botinko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks very complex as it requires a lot of immersion in the code to understand the complexity of the algorithm. There is a serious lack of a test that would handle significant cases in BuildPersistentFields and GetBaseFields.

@SergeiPavlov
Copy link
Collaborator Author

SergeiPavlov commented Nov 28, 2023

There is a serious lack of a test that would handle significant cases in BuildPersistentFields and GetBaseFields.

I'm relying on existing tests. Looks like they cover all non-trivial cases (virtual Fields, fields from interfaces, new fields, recycled fields). During developement of this implementation I investigated many failed tests and improvend the implementation to satisfy them.

Anyway I have not merged it into master-servicetitan, lets test it for a while on ST app.

@botinko
Copy link

botinko commented Dec 1, 2023

@SergeiPavlov
I see, that existent tests covers many cases.
I suspect that in the long run the lack of dedicated tests for this feature will make maintaining and developing this code problematic. The code is forgotten very quickly and after a couple of months it will no longer be possible to figure it out.
Tests give at least some chance to understand the logic and important features of the code.

I would just collect all non-trivial cases (virtual Fields, fields from interfaces, new fields, recycled fields, structs) in some test fixture.

@SergeiPavlov
Copy link
Collaborator Author

I would just collect all non-trivial cases (virtual Fields, fields from interfaces, new fields, recycled fields, structs) in some test fixture.

This would be copy/pasting existing tests

@SergeiPavlov SergeiPavlov merged commit dc6346f into master-servicetitan Dec 20, 2023
@SergeiPavlov SergeiPavlov deleted the indexedFields branch December 20, 2023 22:49
SergeiPavlov added a commit that referenced this pull request Dec 23, 2023
…ead of search in Dictionary by string field name (#158)

* ARCH-6354: Optimize Get/SetFieldValue() to use integer indexes instead of search by string key

* Correct for IssueJira0538 test case

* Refactor

* Refactor

* non-Public fields too

* add comment

* rename

* Fix issue witn `new` property specifier

* Fix Flaky test

* Fix BuildPersistentFields()

* Skip overridden persistent properties

* Correctly process overriddent properties

* DOn't ignore abstract props

* Add EOL

* Upgrade to Ubuntu 22.04

* Fix assigning prop index

* Fix processing virtual fields

* Minor fix

* process IsStructure bases

* Fix a few cases

* Fix QueryCompositeTest case

* Process Recycled fields

* Optimize Field mapping

* Refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants