Skip to content

Conversation

@VSadov
Copy link
Member

@VSadov VSadov commented Apr 14, 2025

This is a possible way to speed up the GetParallelMethodDesc - in most cases switching from linear to constant time.
(where N is the number of methoddescs in a type)

It is a space-for-speed trade that we typically do only for something we need to look up at run time. At JIT time may be not enough reason.
We should know at some point if this is necessary

I am not going to merge this. Just to show that it is possible and what a potential optimization could entail.
(per item (VM) Optimize MethodTable::GetParallelMethodDesc in dotnet/runtime#113976

@VSadov VSadov added * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons) area-async Runtime generate async state machines labels Apr 14, 2025
if (!fCanHaveNonVtableSlots ||
it->GetMethodType() == mcInstantiated)
it->GetMethodType() == mcInstantiated ||
it->GetAsyncMethodKind() != AsyncMethodKind::NotAsync)
Copy link
Member Author

Choose a reason for hiding this comment

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

This would force async/task-returning methods to have real slots. This is the "size" tradeoff.

@VSadov VSadov requested a review from jakobbotsch April 14, 2025 15:49
@VSadov
Copy link
Member Author

VSadov commented Apr 14, 2025

@jakobbotsch - just in case you have questions, thoughts other ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-async Runtime generate async state machines * NO MERGE * The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant