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

[changelog skip] Reduce puma_parser struct padding #2590

Merged
merged 1 commit into from Apr 5, 2021

Conversation

calvinxiao
Copy link
Contributor

Description

Modify puma_parser struct to remove 8 bytes padding in 64-bit machine.

benchmarks/wrk/hello.sh shows performance improvement from 4631.424 to 4750.686 (5 times average).

I use Ruby 3.0.0 and WSL2 Ubuntu 20.04

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@dentarg
Copy link
Member

dentarg commented Apr 4, 2021

If you're not that familiar with C (like me): https://stackoverflow.com/questions/2748995/struct-memory-layout-in-c

@nateberkopec
Copy link
Member

@calvinxiao Thank you and welcome to the project! C programmers are like gold to us, I hope you stick around.

The change makes sense after reading @dentarg's link, but I'll just defer to one of the resident C programmers (@MSP-Greg or @evanphx) to merge.

@evanphx
Copy link
Member

evanphx commented Apr 5, 2021

Thanks @dentarg !

@evanphx evanphx merged commit 9eaa5b9 into puma:master Apr 5, 2021
@dentarg
Copy link
Member

dentarg commented Apr 5, 2021

This one was all @calvinxiao :)

@calvinxiao calvinxiao deleted the reduce-http-parser-size branch April 7, 2021 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants