New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sync: documentation for Map is inadequate #21587
Comments
See also #20973. |
I believe these points are already addressed in the current documentation, but it's always difficult for someone close to the implementation to document it from a newcomer's perspective. Concrete suggestions would be helpful.
"It is safe for multiple goroutines to call a Map's methods concurrently."
"It is optimized for use in concurrent loops with keys that are stable over time, and either few steady-state stores, or stores localized to one goroutine per key." "For use cases that do not share these attributes, it will likely have comparable or worse performance and worse type safety than an ordinary map paired with a read-write mutex." |
I think it's odd enough it deserves a little textual example, like "accessing a mostly read-only map under high concurrency" or something along those lines." You hint at this but in an operational way rather than an illustrative one. |
how to understand
|
@yiv We don't use the issue tracker to ask questions. Please see https://golang.org/wiki/Questions. Thanks. |
Change https://golang.org/cl/83796 mentions this issue: |
What's there is correct but unhelpful. How does it differ from the map type? When should it be used? When should it not be used? What are its performance characteristics.
I think a newcomer would find what's there inadequate to understand what it's for.
The text was updated successfully, but these errors were encountered: