oracle / odpi

ODPI-C: Oracle Database Programming Interface for Drivers and Applications
https://oracle.github.io/odpi/
Other
264 stars 75 forks source link

Optimalize structs for size (alignment by rearranging) #149

Open tgulacsi opened 3 years ago

tgulacsi commented 3 years ago
go get -u github.com/orijtech/structslop/cmd/structslop
structslop github.com/godror/godror

reported a few structs that could be rearranged to become smaller.

I understand that *char and its length should be together, so maybe this rearrangement has too few gains and too big price for structs that are only have a few instances in a program, such as dpiConnCreateParams or dpiCommonCreateParams.

But may more gain more with dpiSubscrMessageTable and dpiSubscrMessage.

tgulacsi commented 3 years ago

structslop.patch.txt

anthony-tuininga commented 3 years ago

@tgulacsi, thanks for the suggestion. That's something that could only be considered for version 5 when structure changes like these are possible without breaking backwards compatibility. So I'll keep this in mind when version 5 is being prepped.