Skip to content
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

runtime: squeeze Hchan into 64 bytes #8901

dvyukov opened this issue Oct 7, 2014 · 2 comments

runtime: squeeze Hchan into 64 bytes #8901

dvyukov opened this issue Oct 7, 2014 · 2 comments


Copy link

dvyukov commented Oct 7, 2014

Currently Hchan is 12 words (on 64-bit machine). It would be nice to squeeze it into 8
words. First it's just memory consumption reduction, and second it will be exactly cache
line (and due to malloc alignment, it will be also cache line aligned) which will
speedup contented synchronization - ping-pong only one line instead of two + no false

elemtype goes away as it is not needed.
dataqsiz is a derivative of qcount/sendx/recvx, so it just goes away as well.
recvq/sendq can be reduced to 1 pointer to a head of doubly-linked cycle of waiters.
This gives exactly 8 words.

FTR, here is a CL that lowers OCAP/OLEN for chans into runtime calls (necessary to
remove dataqsiz):
Copy link

rsc commented Oct 7, 2014

Comment 1:

Labels changed: added release-go1.5, removed release-none.

Copy link

rsc commented Jun 8, 2015

Too late for Go 1.5.

@rsc rsc modified the milestones: Unplanned, Go1.5 Jun 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants