Skip to content

Rethink memory overhead of SourceLocation  #2208

Closed

Description

@andimarek

Every single Ast Element has SourceLocation which is probably too much. It is only needed for errors and consumes a lot of memory unused otherwise.

We should think of ways optimizing it.

Activity

  1. changed the title [-]Rethink memory overhead of SourLocation [/-] [+]Rethink memory overhead of SourceLocation [/+] on Feb 17, 2021
  2. deepakguruu commented on May 5, 2021

    @deepakguruu

    We have faced a similar issue where source location object utilised additional memory(about 150KB, 15% of schema object).
    Any updates on the fix for this issue @andimarek

  3. thalapura-alapurom commented on Nov 21, 2023

    @thalapura-alapurom

    Hi

    We are facing the same issue where out of 16 MB [Total size of GraphQL], nearly 2 MB is occupied by this SourceLocation objects. Kindly let me know if any solution is already released or in near future.

    Screenshot 2023-11-21 at 2 37 43 PM
  4. bbakerman commented on Nov 23, 2023

    @bbakerman
    Member

    graphql.parser.ParserOptions#isCaptureSourceLocation can be set to false to stop the parser from creating SourceLocation objects. It's on by default but it can be turned off

    This was added July 2021

  5. thalapura-alapurom commented on Nov 30, 2023

    @thalapura-alapurom

    Thanks @bbakerman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions