Skip to content

Align stuctures for 64-bit platforms#328

Open
GermanAizek wants to merge 1 commit intoAtoptool:masterfrom
GermanAizek:align-structures-for-64bit
Open

Align stuctures for 64-bit platforms#328
GermanAizek wants to merge 1 commit intoAtoptool:masterfrom
GermanAizek:align-structures-for-64bit

Conversation

@GermanAizek
Copy link
Contributor

@GermanAizek GermanAizek commented Mar 12, 2025

@Atoptool,
This PR will decrease costs copying, moving, and creating object-structures only for common 64bit processors due to the 8-byte data alignment.

Smaller size structure or class, higher chance putting into CPU cache. Most processors are already 64 bit, so the change won't make it any worse.

Info about technique:

https://hpc.rz.rptu.de/Tutorials/AVX/alignment.shtml

https://wr.informatik.uni-hamburg.de/_media/teaching/wintersemester_2013_2014/epc-14-haase-svenhendrik-alignmentinc-presentation.pdf

https://en.wikipedia.org/wiki/Data_structure_alignment

https://stackoverflow.com/a/20882083

https://zijishi.xyz/post/optimization-technique/learning-to-use-data-alignment/

Affected structs:

  • extraparam 120 -> 112 bytes
  • vertval 136 -> 128 bytes
  • pridef 48 -> 40 bytes
  • syscap 64 -> 56 bytes

- extraparam 120 -> 112 bytes
- vertval 136 -> 128 bytes
- pridef 48 -> 40 bytes
- syscap 64 -> 56 bytes
@GermanAizek
Copy link
Contributor Author

Updated to master branch.

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.

1 participant