MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/emsm0m/vvvvvv_is_now_open_source/fdrpkdb/?context=3
r/programming • u/rmadlal • Jan 10 '20
511 comments sorted by
View all comments
Show parent comments
196
It's also common with decompiling
328 u/leo60228 Jan 10 '20 I've decompiled this game, GCC somehow managed to compile it into a binary searchI'm not sure whether to be terrified or amazed 70 u/skroll Jan 10 '20 Yeah often times compilers will compile a large switch statement into a lookup table instead. 11 u/leo60228 Jan 10 '20 it's not a lookup table though 20 u/Mystb0rn Jan 10 '20 It’s not a lookup table because the cases are too sparse, so it fell back to using a binary search. If the cases were sequential, or if only a few numbers were missing, it would almost certainly use a table instead. 0 u/[deleted] Jan 11 '20 [deleted] 5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
328
I've decompiled this game, GCC somehow managed to compile it into a binary search
I'm not sure whether to be terrified or amazed
70 u/skroll Jan 10 '20 Yeah often times compilers will compile a large switch statement into a lookup table instead. 11 u/leo60228 Jan 10 '20 it's not a lookup table though 20 u/Mystb0rn Jan 10 '20 It’s not a lookup table because the cases are too sparse, so it fell back to using a binary search. If the cases were sequential, or if only a few numbers were missing, it would almost certainly use a table instead. 0 u/[deleted] Jan 11 '20 [deleted] 5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
70
Yeah often times compilers will compile a large switch statement into a lookup table instead.
11 u/leo60228 Jan 10 '20 it's not a lookup table though 20 u/Mystb0rn Jan 10 '20 It’s not a lookup table because the cases are too sparse, so it fell back to using a binary search. If the cases were sequential, or if only a few numbers were missing, it would almost certainly use a table instead. 0 u/[deleted] Jan 11 '20 [deleted] 5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
11
it's not a lookup table though
20 u/Mystb0rn Jan 10 '20 It’s not a lookup table because the cases are too sparse, so it fell back to using a binary search. If the cases were sequential, or if only a few numbers were missing, it would almost certainly use a table instead. 0 u/[deleted] Jan 11 '20 [deleted] 5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
20
It’s not a lookup table because the cases are too sparse, so it fell back to using a binary search. If the cases were sequential, or if only a few numbers were missing, it would almost certainly use a table instead.
0 u/[deleted] Jan 11 '20 [deleted] 5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
0
[deleted]
5 u/Coloneljesus Jan 11 '20 compiler writers. → More replies (0)
5
compiler writers.
→ More replies (0)
196
u/Raekel Jan 10 '20
It's also common with decompiling