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

Fast Attribute Access #2921

Merged
merged 2 commits into from
Nov 8, 2024
Merged

Fast Attribute Access #2921

merged 2 commits into from
Nov 8, 2024

Conversation

tabuna
Copy link
Member

@tabuna tabuna commented Nov 8, 2024

When calling the getContent() method, the model is transformed into a flat structure, allowing for dot notation searches.

However, converting the model to an array triggers all its type casts.

In my experience, direct access to specific attributes is far more common than dot notation usage. Therefore, in this Pull Request, I adjusted the value retrieval order so that type casting only occurs when dot notation is needed.

In my experiments, this change resulted in a noticeable performance improvement.

@tabuna tabuna merged commit df2e842 into master Nov 8, 2024
20 of 22 checks passed
@tabuna tabuna deleted the perfomance_model_get_content branch November 8, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant