FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Retriveing singleton property fetchers will not create DataFetcherFactoryEnvironment objects by bbakerman · Pull Request #3942 · graphql-java/graphql-java · GitHub

Retriveing singleton property fetchers will not create DataFetcherFactoryEnvironment objects - #3942

Merged
dondonz merged 1 commit into
masterfrom
fix-to-singleton-property-to-not-create-objects
May 14, 2025
Merged

Retriveing singleton property fetchers will not create DataFetcherFactoryEnvironment objects#3942
dondonz merged 1 commit into
masterfrom
fix-to-singleton-property-to-not-create-objects

Conversation

bbakerman commented Apr 29, 2025
edited
Loading

Copy link
Copy Markdown
Member

This was always the intention here when we created #3754 to have a singleton property fetcher instance

However we didnt do the factory right and hence DataFetcherFactoryEnvironment are created when they dont need to be

This fixes on of the items found in #3939

Namely why was "graphql.schema.DataFetcherFactoryEnvironment" being 2% of objects allocated

This fixes that

re : #3941

…reate `DataFetcherFactoryEnvironment` objects for simple property fetchers
bbakerman added the performance work that is primarily targeted as performance improvements label Apr 29, 2025
bbakerman requested review from andimarek and dondonz April 29, 2025 13:00
public DataFetcher<Object> get(GraphQLFieldDefinition fieldDefinition) {
return SINGLETON_FETCHER;
}
};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

because I didnt override the default public DataFetcher<Object> get(GraphQLFieldDefinition fieldDefinition) then it returned null and hence it went to the older more heavy weight object and a DataFetcherFactoryEnvironment needed to be allocated.

This now means that no DataFetcherFactoryEnvironment objects are allocated for property fetchers

bbakerman Apr 29, 2025
edited
Loading

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I cant unit test this - its not observable - but profiling shows it to be working!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nice you could verify via profiling

Copy link
Copy Markdown
Contributor

Test Results

  312 files    312 suites   53s ⏱️
3 581 tests 3 576 ✅ 5 💤 0 ❌
3 670 runs  3 665 ✅ 5 💤 0 ❌

Results for commit ade6100.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance work that is primarily targeted as performance improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL