Skip to content
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

[Core] Use Vector for MethodInfo::arguments #91660

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AThousandShips
Copy link
Member

@AThousandShips AThousandShips commented May 7, 2024

One of the bigger offenders when it comes to using a bidirectional data type for random-access purposes, there aren't really any good reasons to use a List here that I can tell, we never do any insertions or erasures on it (one case in Node but it wasn't necessary, and IMO worsened readability)

Nothing should really change here except improving some data management, and locality, and making accessing the arguments easier, performance should be unaffected either way but haven't done any direct testing on that part, but I don't think this data is used in critical paths anyway

Follow-up to:

@AThousandShips AThousandShips added this to the 4.3 milestone May 7, 2024
@AThousandShips AThousandShips requested a review from lawnjelly May 7, 2024 12:02
@AThousandShips AThousandShips requested review from a team as code owners May 7, 2024 12:02
@AThousandShips AThousandShips modified the milestones: 4.3, 4.4 Jun 19, 2024
@AThousandShips AThousandShips force-pushed the methodinfo_vec branch 2 times, most recently from aefa43f to 8f5e6aa Compare August 29, 2024 18:12
@AThousandShips AThousandShips changed the title [Core] Use LocalVector for MethodInfo::arguments [Core] Use Vector for MethodInfo::arguments Aug 29, 2024
@AThousandShips AThousandShips requested a review from a team as a code owner October 4, 2024 11:36
@AThousandShips AThousandShips requested a review from a team as a code owner November 14, 2024 16:54
@AThousandShips AThousandShips force-pushed the methodinfo_vec branch 2 times, most recently from 3d7856f to 6a426eb Compare December 5, 2024 17:39
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

Looks correct.

I wonder if it's worth it to switch to range iterators everywhere, i.e.

int i = 0;
for (const PropertyInfo &pi : method.arguments) {
	// stuff
	i++;
}

Avoids indexing the Vector, although it's cheap anyway.

@AThousandShips
Copy link
Member Author

Worth looking at yeah

@AThousandShips AThousandShips force-pushed the methodinfo_vec branch 2 times, most recently from 3e05520 to ccfc923 Compare December 12, 2024 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants