Giter Site home page Giter Site logo

Comments (4)

acao avatar acao commented on September 21, 2024

hey I hope to make a relase of the phase 1 rewrite today to solve this problem! it will be a new major release

from graphiql.

addiebarron avatar addiebarron commented on September 21, 2024

@acao that's amazing!! could you clarify a bit more about how it will be solved? I noticed it's sort of possible on the pre-release branch, but it's pretty slow, and the click-through doesn't link to the correct line (it seems like it calculates the definition's line within the gql tag, then links to that line within the file, so it's off by the number of lines between the start of the file and the start of the gql tag).

from graphiql.

acao avatar acao commented on September 21, 2024

@addiebarron oh dear, well that is not good news haha! i mean, it's great news in that it's the first unexpected bug report for the pre-release, as I have a few new test cases for what should be this scenario, so this is very very good to know something is missing or else I would have made a broken release!

Though that pre-release I uploaded is a bit out of date, the issue is likely still present. Can you provide a few example file snippets of the mix of config/schema/code files etc to reproduce the jump to definition offset bug?

Also, I'm sad to know it's much slower for you, I've been testing with a small group of maybe 12 files, so I was hoping to open a work project today as well, as I feared this could also be the case. A likely explanation for this (i will need to profile) is that many of the bugs I fix in this first stage of the rewrite involve properly updating and even writing to the cache when we were not before, due to bugs that just weren't caught in the unit test because the MessageProcessor instance lifecycle was too short (as unit tests should be!).

Thus why I added the new high-level integration suite at essentially the LSP protocol level, and thus revealed all these cache misses and issues that should not be happening (and tracking down the root and fixing, etc)! What's more, these caches and the parsing are in duplicate because of some flaws I inherited and haven't taken up to reconcile or worsened accidentally (until rewrite phase 2, where I consolidate the file and schema caches, and consolidate the parsing to )

As you may agree with your expertise, increased parsing and writes to and duplications of the various in memory caches means both way more in memory cacheing.

Also, a benchmark suite should be added to measure performance before this release. Some memory profiling with a larger project might help me track down some issues to target with the benchmarking. Initial project load (even with 12 files) and the definition lookups seemed slower to me, what else feels slower to you? Just everything? How many code files with/without graphql tags approximately? is there anything special about the schema, for example custom schema extensions?

(also btw this means i am not releasing! and it is soon monday here anyways πŸ˜† ) I need to take more time with this, and if the second stage of the rewrite proves to be more performant measurably than the 1st stage, then perhaps we will join them together, perhaps as separate PR merges but the same major release. if both prove to be significantly worse off than what's currently stable, then first I timebox targeting the perf issues, and if they persist without major changes then I go back to the drawing board, because performance is already an issue, I can't bring myself to make it worse!

If you wanted to try the 2nd stage rewrite out with vscode, and/or tinker with it (PRs against my PRs or main are welcome ofc!), you could take these steps:

  1. clone
  2. yarn, make some coffee πŸ₯±
  3. run the VSCode LSP Extension under "Run and Debug" dropdown in vscode
  4. select the project you want to test with in a new window
  5. when you want to test changes, just click the refresh button in the source editor

from graphiql.

acao avatar acao commented on September 21, 2024

Also thank you so much for taking the time to try out the pre-release, you saved us all so much pain haha

from graphiql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.