question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Really slow for huge list of objects

See original GitHub issue
type FooBar {
  # some more flat fields
}

type Bar {
  n: Int!
  sub: FooBar!
}

type Foo {
  foo: [Bar!]!
}

We have a structure like this. The foo property on Foo can contain thousands of items. Sadly we need all of them at once, so we can’t paginate over it. There’s only one resolver to resolve foo itself which is quite fast (getting the nested object from a Mongo DB). Our current workaround is to implement a custom JSON scalar which just returns the data, by-passing all child resolvers. But this way we’re loosing everything that GraphQL gives us. Is there anything that can be used to speed this up without using a JSON scalar or is this the best solution already? I know that GraphQL comes with some overhead but this can go up to 20 seconds vs 1 second with JSON scalar.

We’re using Ariadne in sync-mode.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
cancan101commented, Jan 28, 2021

@rafalp any updates on getting the 0.13 release of Ariadne published with the upgrading of graphql-core to 3.1 change?

1reaction
rafalpcommented, Sep 1, 2020

@levrik correct. We’ve updated GraphQL-Core to 3.1 in 0.13 and will ship it in few weeks, once the rest of features pull requests have been merged.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Filter large list object on data from another large list: slow ...
First I though of a solution with Hashet<> or Dictionary<> but that doesn't really fit into this use case. How about speeding it...
Read more >
Why adding new objects to List/Dictionary is so slow (>200 ns ...
But you must be carefull that you don't be slowed down by garbage collection, too! So you have to store a reference to...
Read more >
List.Distinct() is running really slow with 2 million+ objects
ToList() calls, especially considering after doing all the work to build the lists you throw them away? Next: "Why is Distinct() taking so...
Read more >
How to fix slow List updates in SwiftUI - Hacking with Swift
The problem is, it's trying to compare 600 row items against 600 other row items, and that's extremely slow. Worse, if we had...
Read more >
Related List is Loading the sc task very slow. - ServiceNow
You query seems fine but may be due to large number of records in sys_email table it is taking the to get the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found