-
Notifications
You must be signed in to change notification settings - Fork 790
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
Optimize metadata members and custom attributes reading #17364
Optimize metadata members and custom attributes reading #17364
Conversation
❗ Release notes required
|
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.
The benchmarks seem almost too good to be true :)
@KevinRansom, just in case, maybe you have some ideas for extra testing here?
@psfinaki, some additional explanations for the benchmark: It forces members/attributes reading to check the total profit that we can achieve in reading. In a full analysis, these same results will be distributed over time due to lazy evaluation. During the phase of searching for a range of rows in the table, a complete set of fields for each checked row was read and cached, even if only the key was needed. From here, there is a reduction in search time, since only the key is read; in memory, since only the rows from the found range are cached, the intermediate ones needed only for search are not cached. |
Similar to benchmark from #16168 (comment), sequential analysis of all files in ReSharper.FSharp/FSharp.Psi.Services with additional unused opens in some files
Sure, it is possible to find a more illustrative example. |
@DedSec256 thanks for sharing a full(er) picture. The original benchmarks are still useful information since they show how much space for optimization we have here. Thanks for tackling this bit by bit :) |
@KevinRansom happy to merge after your approval. |
I thought this already merged and I was checking for this in the latest net9 preview. I know we are all busy but, Please let’s value people’s time. |
We will merge it once we have 3 or more approvals from the team, we literally had everyone on the team on a leave except 2 people for a few weeks. |
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 good
Now the search for custom attributes and type members in metadata tables is performed as follows:
Currently,
So, during the search, a lot of unnecessary data is read and stored in cache.
This PR suggests an approach used in #16168:
rowConverter
function calledThus, for optimization in this PR, the data for
seekReadEvents
,seekReadMethodImpls
,seekReadProperties
, andcustomAttrsReader
are suitable.In order to verify the optimization, 450 assemblies from the ReSharper.FSharp/FSharp.Psi.Services project were taken and the following benchmark was written: