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

Optimize struct field order to reduce memory usage #1809

Merged
merged 1 commit into from
Jul 20, 2024

Conversation

ksw2000
Copy link
Contributor

@ksw2000 ksw2000 commented Jul 20, 2024

  1. Reduce RequestHeader from 368 bytes to 360 bytes
  2. Reduce Request from 816 bytes to 800 bytes
  3. Reduce Response from 432 bytes to 416 bytes
  4. Reduce Client from 312 bytes to 288 bytes
  5. Reduce HostClient from 416 bytes to 392 bytes
  6. Reduce PipelineClient from 176 bytes to 168 bytes
  7. Reduce pipelineConnClient from 216 bytes to 208 bytes
  8. Reduce Cookie from 232 bytes to 224 bytes
  9. Reduce FS from 184 bytes to 160 bytes
  10. Reduce fsHandler from 168 bytes to 160 bytes
  11. Reduce ResponseHeader from 328 bytes to 320 bytes
  12. Reduce headerScanner from 128 bytes to 120 bytes
  13. Reduce TCPDialer from 104 bytes to 96 bytes
  14. Reduce workerPool from 152 bytes to 144 bytes

1. Reduce RequestHeader from 368 bytes to 360 bytes
2. Reduce Request from 816 bytes to 800 bytes
3. Reduce Response from 432 bytes to 416 bytes
4. Reduce Client from 312 bytes to 288 bytes
5. Reduce HostClient from 416 bytes to 392 bytes
6. Reduce PipelineClient from 176 bytes to 168 bytes
7. Reduce pipelineConnClient from 216 bytes to 208 bytes
8. Reduce Cookie from 232 bytes to 224 bytes
9. Reduce FS from 184 bytes to 160 bytes
10. Reduce fsHandler from 168 bytes to 160 bytes
11. Reduce ResponseHeader from 328 bytes to 320 bytes
12. Reduce headerScanner from 128 bytes to 120 bytes
13. Reduce TCPDialer from 104 bytes to 96 bytes
14. Reduce workerPool from 152 btyes to 144 btyes
@erikdubbelboer erikdubbelboer merged commit 86c7e84 into valyala:master Jul 20, 2024
19 checks passed
@erikdubbelboer
Copy link
Collaborator

Thanks!

@gaby
Copy link
Contributor

gaby commented Jul 20, 2024

@erikdubbelboer I figured this was also affecting bytebufferpool, and it is. So I sent a PR for that repo. valyala/bytebufferpool#29

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants