Performance Tuning
How incremental computation works
Section titled “How incremental computation works”GraphQL Analyzer uses Salsa for incremental computation. When a file changes, only the queries that depend on that file are recomputed. Everything else is served from cache.
Edit one file out of 100 → Only that file is re-validatedEdit schema → All documents re-validated (schema is a shared dependency)LSP vs CLI performance characteristics
Section titled “LSP vs CLI performance characteristics”| Aspect | LSP (editor) | CLI (CI/CD) |
|---|---|---|
| Update model | Incremental per-file | Full batch |
| Rule budget | Fast rules only | All rules |
| Typical latency | Milliseconds | Seconds |
Expensive rules
Section titled “Expensive rules”Project-wide rules like noUnusedFields and noUnusedFragments analyze all documents together and can be slow in very large projects. If you experience latency in the editor, disable them in your config and run them in CI instead:
extensions: graphql-analyzer: lint: extends: recommended rules: noUnusedFields: off noUnusedFragments: offThen in CI, enable them explicitly:
graphql check --rule noUnusedFields=error --rule noUnusedFragments=errorStructure/body separation
Section titled “Structure/body separation”The analyzer separates schema structure (type definitions) from operation bodies. This means:
- Editing an operation doesn’t recompute schema analysis
- Editing the schema recomputes everything that depends on types
- Fragment indexes are stable across operation edits
This is key to keeping the IDE responsive in large codebases.
Debugging performance
Section titled “Debugging performance”Enable OpenTelemetry tracing
Section titled “Enable OpenTelemetry tracing”In VS Code settings (Preferences: Open User Settings (JSON)):
{ "graphql-analyzer.debug.otelEnabled": true, "graphql-analyzer.debug.otelEndpoint": "http://localhost:4317"}4317 is the OTLP gRPC ingestion endpoint (the collector). View traces in Jaeger’s UI at http://localhost:16686 (requires Jaeger running locally — these are two different ports with different purposes).
Enable debug logging
Section titled “Enable debug logging”In VS Code settings:
{ "graphql-analyzer.debug.logLevel": "debug", "graphql-analyzer.server.env": { "RUST_LOG": "debug" }}For the CLI:
RUST_LOG=debug graphql validate