Skip to content

Conversation

@calvernaz
Copy link
Contributor

  • packets.RXPK size goes from 168 bytes to 152 bytes (16 bytes).
  • packets.TXPK size goes from 144 bytes to 120 bytes (24 bytes).

@brocaar
Copy link
Collaborator

brocaar commented Mar 18, 2019

Could you let me know what exactly has been improved? I see that you re-ordered some fields but from a quick look at the diff I do not understand:

  • packets.RXPK size goes from 168 bytes to 152 bytes (16 bytes).
  • packets.TXPK size goes from 144 bytes to 120 bytes (24 bytes).

@calvernaz
Copy link
Contributor Author

So reordering the fields in those two structs removes the unnecessary padding, saving bytes and gives better memory layout

@calvernaz
Copy link
Contributor Author

@brocaar makes sense?

@brocaar brocaar merged commit 689eda5 into chirpstack:master Mar 22, 2019
@calvernaz calvernaz deleted the struct-layout branch March 22, 2019 19:25
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.

2 participants