Skip to content

Performance problem even for small query on big schema. #569

@l-you

Description

@l-you

I widely use GraphQLite for admin console in my Symphony project. I really enjoy it!
The only reason I don't use it for public API is overhead in execution speed.

For example such simple query

query ProductFeedbackManager_feedback_count(
    $input: ProductFeedbackSearchInput!
) {
    productFeedbacksCount(input: $input)
}

Such simple query have overhead of ~100-140ms comparing to simple RESTful endpoint with the same logic.

Here is some screenshots of XDebug profiler output
Screenshot 2023-03-08 at 17 20 29

Screenshot 2023-03-08 at 17 21 50

I would like to discuss about ideas how codebase could be improved in direction of execution speed.

For example, if we look deeper into AggregateControllerQueryProvider->getQueries() we would see such picture.
Screenshot 2023-03-08 at 17 34 12
Method mapReturnType takes 9% of the execution time for the entire script.
Inside mapReturnType we have many nested toGraphQLOutputType() called by type mappers. Almost 5k following the screenshot.

As I know primary work for type mappers is converting docblocks/attibutes Type to GraphQL type.
So, is there a way we could move such logic to the compile time? Or, maybe some kind of generated code that is stored in cache like in overblog/GraphQLBundle

Im pretty sure there are many things that could be optimised. But seems it cannot be done without breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions