go/internal/jsonrpc2
Robert Findley 87f47bbfb4 gopls/internal/regtest/bench: refactor and improve benchmarks
Significantly refactor the gopls benchmarks to turn them into proper
benchmarks, eliminate the need for passing flags, and allow running them
on external gopls processes so that they may be used to test older gopls
versions.

Doing this required decoupling the benchmarks themselves from the
regtest.Runner. Instead, they just create their own regtest.Env to use
for scripting operations. In order to facilitate this, I tried to
redefine Env as a convenience wrapper around other primitives.

By using a separate environment setup for benchmarks, I was able to
eliminate a lot of regtest.Options that existed only to prevent the
regtest runner from adding instrumentation that would affect
benchmarking. This also helped clean up Runner.Run somewhat, though it
is still too complicated.

Also eliminate the unused AnyDiagnosticAtCurrentVersion, and make a few
other TODOs about future cleanup.

For golang/go#53992
For golang/go#53538

Change-Id: Idbf923178d4256900c3c05bc8999c0c9839a3c07
Reviewed-on: https://go-review.googlesource.com/c/tools/+/419988
gopls-CI: kokoro <noreply+kokoro@google.com>
Reviewed-by: Peter Weinberger <pjw@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-08-04 14:58:59 +00:00
..
servertest gopls/internal/regtest/bench: refactor and improve benchmarks 2022-08-04 14:58:59 +00:00
conn.go internal/jsonrpc2: change jsonrpc2.Conn to be an interface 2020-06-03 17:06:45 +00:00
handler.go internal/event: renaming the main event API functions 2020-04-23 17:21:36 +00:00
jsonrpc2.go internal/jsonrpc2: change jsonrpc2.Conn to be an interface 2020-06-03 17:06:45 +00:00
jsonrpc2_test.go internal/jsonrpc2: change jsonrpc2.Conn to be an interface 2020-06-03 17:06:45 +00:00
messages.go internal/jsonrpc2*: remove usage of golang.org/x/xerrors 2022-04-20 16:10:40 +00:00
serve.go internal/jsonrpc2*: remove usage of golang.org/x/xerrors 2022-04-20 16:10:40 +00:00
serve_test.go internal/stack: add the leak test 2020-05-27 14:25:42 +00:00
stream.go internal/jsonrpc2: switch to building streams on top of net.Conn 2020-06-03 13:12:18 +00:00
wire.go all: fix spelling 2022-04-04 19:50:34 +00:00
wire_test.go internal/jsonrpc2: omit empty error data 2020-06-24 06:08:01 +00:00