]> Cypherpunks repositories - gostls13.git/commit
go/token: benchmark FileSet.{Position,AddExistingFiles}
authorAlan Donovan <adonovan@google.com>
Fri, 23 May 2025 15:35:41 +0000 (11:35 -0400)
committerGopher Robot <gobot@golang.org>
Tue, 27 May 2025 18:03:31 +0000 (11:03 -0700)
commitc146a61d4c9f76484206a83fa0aac64547f8acdf
treed70a11993fcad532c79f8fa689381f5233ccca55
parentae0824883e7f851173ff1855ad1c638bec87a426
go/token: benchmark FileSet.{Position,AddExistingFiles}

This CL adds a benchmark of FileSet.Position, the lookup
operation, and the new AddExistingFiles. It is evident
that its behavior is quadratic in important cases:

(Apple M1)
BenchmarkFileSet_AddExistingFiles/sequence-8                 3  362768139 ns/op

Change-Id: I256fdc776135e1924666d127afb37dacbefc860f
Reviewed-on: https://go-review.googlesource.com/c/go/+/675875
Reviewed-by: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
src/go/token/export_test.go [new file with mode: 0644]
src/go/token/position_bench_test.go