From 20c1c1560883ee4ce6850498280b3ae98c0101bc Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Tue, 4 Jun 2024 18:07:44 +0800 Subject: [PATCH] schema: Document perf scaling for occurrences(...) (#62941) Fixes GRAPH-634 --- .../graphqlbackend/codeintel.codenav.graphql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cmd/frontend/graphqlbackend/codeintel.codenav.graphql b/cmd/frontend/graphqlbackend/codeintel.codenav.graphql index 06eed14ca3e..fcf4c939139 100644 --- a/cmd/frontend/graphqlbackend/codeintel.codenav.graphql +++ b/cmd/frontend/graphqlbackend/codeintel.codenav.graphql @@ -118,7 +118,26 @@ type CodeGraphData { """ Occurrences are guaranteed to be sorted by range. It is possible for there to be multiple occurrences for the same exact source range. + + At the moment, using higher values of 'first:' should not cause + significantly worst performance. + + As an example, for a large C++ codebase, here are the percentiles + for number of occurrences per document. + + | Percentile | Occurrences count | + | 50 | 241 | + | 90 | 2443 | + | 95 | 4554 | + | 99 | 15869 | + | 99.9 | 94465 | + | 100 | 707850 | """ + # Tip: One can get the percentiles above using the scip CLI's 'stats' + # subcommand. (https://github.com/sourcegraph/scip/blob/main/docs/CLI.md#scip-stats) + # + # TODO(issue: GRAPH-635): Allow passing a filter here to only get + # occurrences for specific lines. occurrences(first: Int, after: String): SCIPOccurrenceConnection }