typelevel / typelevel/grackle

Consider a lower level/more performant response representation

Open
#36 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement performance question
Dominant language
Scala
Stars
189
Forks
32
Avg merge
18h 31m
Merged PRs (30d)
37

Description

Currently we construct responses as Circe JsonObjects. @djspiewak observed that this is very costly, and also most likely unnecessary given that we're constructing a single response value bottom up: we could just as easily glom byte arrays together rather than constructing an intermediate structured value.

Simply ripping out Circe (for this role, not everywhere) and replacing with something lower level should be fairly straightforward, but probably isn't an immediate priority.

A slightly more ambitious move would be to support response streaming (ie. start returning the response to the client as soon as the first bytes are available). This might involve some tricky scheduling of nested subqueries for the best results, but I think also should be possible.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, entry points, or tests are named. Start by tracing where GraphQL responses are constructed as Circe JsonObjects, then assess the proposed byte-array representation and the separate streaming idea. Done would require a defined scope, implementation approach, and performance or response-behavior checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.