Skip to content

Performance: Improve NodeTypeResolver::isObjectType() performance#3500

Closed
keulinho wants to merge 1 commit intorectorphp:mainfrom
keulinho:improve-node-type-resolver-performance
Closed

Performance: Improve NodeTypeResolver::isObjectType() performance#3500
keulinho wants to merge 1 commit intorectorphp:mainfrom
keulinho:improve-node-type-resolver-performance

Conversation

@keulinho
Copy link
Copy Markdown
Contributor

NodeTypeResolver::isObjectType() is called from multiple rectory on the same node and taking quite a long time.

By saving the resolved type to the node for later reuse and checking if a object type is actually a trait before analysing all traits improves performance by ~30% in our test run.

see the blackfire comparison here: https://blackfire.io/profiles/compare/49347102-5585-4e90-9a9c-9b4f5e8b74fb/graph

image

@keulinho keulinho requested a review from TomasVotruba as a code owner March 22, 2023 09:34
Copy link
Copy Markdown
Member

@samsonasik samsonasik left a comment

Choose a reason for hiding this comment

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

Type may changed on node refactored by other rules, so it can't be cached.

@samsonasik
Copy link
Copy Markdown
Member

I am going to close it as the node type can be changed on refactored by other rules that follow the scope :)

@samsonasik samsonasik closed this Mar 22, 2023
@keulinho keulinho deleted the improve-node-type-resolver-performance branch March 22, 2023 10:11
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