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

save a whopping 12 bytes from Color struct #3621

Merged

Conversation

Rylxnd
Copy link
Contributor

@Rylxnd Rylxnd commented Oct 19, 2023

how generous of us ;)

@ReiDaTecnologia
Copy link

image

@Rylxnd
Copy link
Contributor Author

Rylxnd commented Oct 19, 2023

memory usage must be efficient of course ;)

@ReiDaTecnologia
Copy link

well yes but actually no
1mb i would understand but 12 bytes? '_'

@ShufflePerson
Copy link

ShufflePerson commented Oct 20, 2023

well yes but actually no 1mb i would understand but 12 bytes? '_'

12 bytes is 12 bytes, imagine everything you can do with it.
You could for example store the number 7.9228163e+28!!

Jokes aside, even saving 12 bytes is worth it, any and all optimizations, as long as they don'truin the codebase, should be made if someone has the time.

@ReiDaTecnologia
Copy link

well yes but actually no 1mb i would understand but 12 bytes? '_'

12 bytes is 12 bytes, imagine everything you can do with it. You could for example store the number 7.9228163e+28!!

Jokes aside, even saving 12 bytes is worth it, any and all optimizations, as long as they don'truin the codebase, should be made if someone has the time.

Honestly i wish the modern gaming industry cared that much but they only care with money and in saving em (optimization and time is a waste of money for em, sadly)

@Regynate
Copy link
Contributor

You could for example store the number 7.9228163e+28!!

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

@Rylxnd
Copy link
Contributor Author

Rylxnd commented Oct 20, 2023

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

It's indeed pretty big. My calculator gives me an error when trying to do it. (Both my actual calculator and the one on my phone)

@ShufflePerson
Copy link

You could for example store the number 7.9228163e+28!!

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

12 bytes = 12*8 = 96 bits = 2^96 = 7.9228163e+28

@Regynate
Copy link
Contributor

Regynate commented Oct 20, 2023

You could for example store the number 7.9228163e+28!!

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

12 bytes = 12*8 = 96 bits = 2^96 = 7.9228163e+28

7.9228163e+28!! ≈ 10^(10^30.052154446)

@MoneyWasted
Copy link
Collaborator

You could for example store the number 7.9228163e+28!!

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

i think he is talking about all the possible combinations of 12 bytes. that number makes more sense.

@Regynate
Copy link
Contributor

You could for example store the number 7.9228163e+28!!

10^(10^30.052154446) is quite a big number, I'm pretty sure you can't store it using just 12 bytes

i think he is talking about all the possible combinations of 12 bytes. that number makes more sense.

No I'm not, 7.9228163e+28!! ≈ 10^(10^30.052154446)

@Rylxnd
Copy link
Contributor Author

Rylxnd commented Oct 20, 2023

If you do the math, it does add up to 79 octillion. Which makes sense considering a 64 bit number is ≈ 15 quintillion (iirc). And 128 bits ≈ 340 undecillion.

@pongo1231
Copy link
Member

cstdint needs to be included in both headers. Also the types inside std are preferred over the ones in the global namespace (so e.g. uint8_t -> std::uint8_t).

@ReiDaTecnologia
Copy link

Come on guys, obviously it can store 12 cuz each byte is either 0 or 1 :p

@ShufflePerson
Copy link

Come on guys, obviously it can store 12 cuz each byte is either 0 or 1 :p

me when byte != bit

@ReiDaTecnologia
Copy link

ReiDaTecnologia commented Oct 21, 2023

Come on guys, obviously it can store 12 cuz each byte is either 0 or 1 :p

me when byte != bit

Ops, i forgot that bit XD

@ShufflePerson
Copy link

Come on guys, obviously it can store 12 cuz each byte is either 0 or 1 :p

me when byte != bit

Ops, i forgot that bit XD

LMFAO, I love that dad joke. Made me chuckle so hard

@pongo1231 pongo1231 merged commit 51e9d59 into gta-chaos-mod:master Oct 21, 2023
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.

6 participants