Skip to content

Commit b84d509

Browse files
adonovangopherbot
authored andcommitted
gopls/doc: regenerate documentation
This change should have been included in https://go-review.googlesource.com/c/tools/+/415057 but I hastily submitted it without a CI run thinking "how can a doc only change break something?". Well now I know. Sorry. :( Change-Id: Ib0fd25fddd7f9580961b44dcad032d4851684f63 Reviewed-on: https://go-review.googlesource.com/c/tools/+/415058 Reviewed-by: Dmitri Shuralyov <[email protected]> Run-TryBot: Alan Donovan <[email protected]> gopls-CI: kokoro <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Robert Findley <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Bryan Mills <[email protected]>
1 parent c10541a commit b84d509

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

gopls/doc/analyzers.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ of the second argument is not a pointer to a type implementing error.
131131
find structs that would use less memory if their fields were sorted
132132

133133
This analyzer find structs that can be rearranged to use less memory, and provides
134-
a suggested edit with the optimal order.
134+
a suggested edit with the most compact order.
135135

136136
Note that there are two different diagnostics reported. One checks struct size,
137137
and the other reports "pointer bytes" used. Pointer bytes is how many bytes of the
@@ -150,6 +150,11 @@ has 24 pointer bytes because it has to scan further through the *uint32.
150150

151151
has 8 because it can stop immediately after the string pointer.
152152

153+
Be aware that the most compact order is not always the most efficient.
154+
In rare cases it may cause two variables each updated by its own goroutine
155+
to occupy the same CPU cache line, inducing a form of memory contention
156+
known as "false sharing" that slows down both goroutines.
157+
153158

154159
**Disabled by default. Enable it by setting `"analyses": {"fieldalignment": true}`.**
155160

internal/lsp/source/api_json.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)