Reference:
https://groups.google.com/forum/#!msg/golang-nuts/v_kYqKJKyRc/TGUJ_zJrAAAJ
Go doesn't sweep an arbitrary number of spans.
Go doesn't sweep an arbitrary number of spans.
In the current implementation, on the slow path, it looks through a
limited number of spans to find one that has space, and then it sweeps
that one and uses it.
limited number of spans to find one that has space, and then it sweeps
that one and uses it.
It checks up to 100 spans looking for one to sweep; if it doesn't find any in the first 100 that it checks, it allocates a new span. So, there is an upper bound on allocation time.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.