{"action":"opened","issue":{"url":"https://api.github.com/repos/graphql-java/graphql-java/issues/1358","repository_url":"https://api.github.com/repos/graphql-java/graphql-java","labels_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/1358/labels{/name}","comments_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/1358/comments","events_url":"https://api.github.com/repos/graphql-java/graphql-java/issues/1358/events","html_url":"https://github.com/graphql-java/graphql-java/issues/1358","id":393326800,"node_id":"MDU6SXNzdWUzOTMzMjY4MDA=","number":1358,"title":"Large list of DTOs from data fetcher taking very long time to process","user":{"login":"mrubin","id":271245,"node_id":"MDQ6VXNlcjI3MTI0NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/271245?v=4","gravatar_id":"","url":"https://api.github.com/users/mrubin","html_url":"https://github.com/mrubin","followers_url":"https://api.github.com/users/mrubin/followers","following_url":"https://api.github.com/users/mrubin/following{/other_user}","gists_url":"https://api.github.com/users/mrubin/gists{/gist_id}","starred_url":"https://api.github.com/users/mrubin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrubin/subscriptions","organizations_url":"https://api.github.com/users/mrubin/orgs","repos_url":"https://api.github.com/users/mrubin/repos","events_url":"https://api.github.com/users/mrubin/events{/privacy}","received_events_url":"https://api.github.com/users/mrubin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-21T05:57:07Z","updated_at":"2018-12-21T05:57:07Z","closed_at":null,"author_association":"NONE","body":"We are investigating a performance issue when we return a large list of DTOs from a data fetcher. We are using graphql-java 11.0 on java 8/linux (on high-end AWS instances).\r\n\r\nThe schema looks like this:\r\n\r\n```\r\ntype User {\r\n  userId: ID\r\n  email: String\r\n  userName: String\r\n  displayName: String\r\n  avatarUrl: String\r\n  isAdmin: Boolean\r\n  isLockedOut: Boolean\r\n  creationDate: String\r\n}\r\n\r\ntype AdminViewOfUser {\r\n  user: User!\r\n  accountNumber: String\r\n}\r\n\r\nextend type QueryRoot {\r\n  allUsers: [AdminViewOfUser!]\r\n}\r\n```\r\n\r\nWhen using a DTO class (`AdminViewOfUserDTO` which contains `UserDTO` and a `String`) to return ~40,000 users from a data fetcher as `java.lang.Iterable[AdminViewOfUserDTO]`, it takes 1-2 seconds to generate the list in the data fetcher and return it to graphql, and then it takes graphql almost 2 minutes to process that list and return the final result.\r\n\r\nWe have tried switching away from the DTO and instead returning `java.lang.Iterable[java.util.Map[String, java.lang.Object]]` from the data fetcher. This takes significantly less time to process with the same ~40,000 users.\r\n\r\nWe would strongly prefer to use the DTO approach. What is going on (in graphql-java) that it takes such a long time to process? Is there anything we can do to make the DTO faster from graphql-java to process?\r\n\r\nThank you"}}
{"actor":{"display_login":"mrubin"}}