golang.org/x/tools/gopls@v0.15.3/internal/test/integration/bench/doc.go (about)

     1  // Copyright 2023 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // The bench package implements benchmarks for various LSP operations.
     6  //
     7  // Benchmarks check out specific commits of popular and/or exemplary
     8  // repositories, and script an external gopls process via a fake text editor.
     9  // By default, benchmarks run the test executable as gopls (using a special
    10  // "gopls mode" environment variable). A different gopls binary may be used by
    11  // setting the -gopls_path or -gopls_commit flags.
    12  //
    13  // This package is a work in progress.
    14  //
    15  // # Profiling
    16  //
    17  // Benchmark functions run gopls in a separate process, which means the normal
    18  // test flags for profiling aren't useful. Instead the -gopls_cpuprofile,
    19  // -gopls_memprofile, -gopls_allocprofile, and -gopls_trace flags may be used
    20  // to pass through profiling to the gopls subproces.
    21  //
    22  // Each of these flags sets a suffix for the respective gopls profile, which is
    23  // named according to the schema <repo>.<operation>.<suffix>. For example,
    24  // setting -gopls_cpuprofile=cpu will result in profiles named tools.iwl.cpu,
    25  // tools.rename.cpu, etc. In some cases, these profiles are for the entire
    26  // gopls subprocess (as in the initial workspace load), whereas in others they
    27  // span only the critical section of the benchmark. It is up to each benchmark
    28  // to implement profiling as appropriate.
    29  //
    30  // # Integration with perf.golang.org
    31  //
    32  // Benchmarks that run with -short are automatically tracked by
    33  // perf.golang.org, at
    34  // https://perf.golang.org/dashboard/?benchmark=all&repository=tools&branch=release-branch.go1.20
    35  //
    36  // # TODO
    37  //   - add more benchmarks, and more repositories
    38  //   - fix the perf dashboard to not require the branch= parameter
    39  //   - improve this documentation
    40  package bench