Inertia (🇮🇳) on Nostr: Is there any difference between passing a structure of 3 ints by copy vs just passing ...
Is there any difference between passing a structure of 3 ints by copy vs just passing 3 ints individually into a method?
From the amount of bytes copied obviously not. Just wondering if there are some compiler optimisations that get harder/easier when packing values together vs leaving them separate.
Func(int a, int b, int c)
Vs
Func(vector3 v)
Vector3{ int a, int b, int c }
Published at
2024-06-21 18:30:03Event JSON
{
"id": "7959cf25fd62b68a5a78c2a3d5fef117c66f3fa09f7ee309dc74557f22750bad",
"pubkey": "e18127cdb6bc491133c63a14fc421a9291029cafa2245f70a5769febbfae2d70",
"created_at": 1718994603,
"kind": 1,
"tags": [
[
"proxy",
"https://pone.social/users/inertia/statuses/112656030361233088",
"activitypub"
]
],
"content": "Is there any difference between passing a structure of 3 ints by copy vs just passing 3 ints individually into a method?\n\nFrom the amount of bytes copied obviously not. Just wondering if there are some compiler optimisations that get harder/easier when packing values together vs leaving them separate.\n\nFunc(int a, int b, int c)\nVs\nFunc(vector3 v)\n\nVector3{ int a, int b, int c }",
"sig": "45f6d924053659d95a1ce02f2fa93cf0c58b4d13ff044a9389dffde7f2d6fad13e6e30259412ae5acb177692f8f1a481e30205e9c843e8355f4eecf307f20b6b"
}