C++ for the C64 (talk)

FBnil

Waiting to Champion the Pyra to the World...
Joined
Dec 14, 2012
Messages
2,969
Location
Yurp
nice C++ insights...


maybe a rofl around 28 minutes...
 
S

sulu

Guest
Pretty impressive demonstration of how pointless code optimization is in a high level language if you don't know what's going on low level.
 

FBnil

Waiting to Champion the Pyra to the World...
Joined
Dec 14, 2012
Messages
2,969
Location
Yurp
@Eight Bit : It seemed like magic to me too. What? Just by adding a virtual declaration? Zero overhead? Impossibru!

In computer class (a long time ago), we once analized the assembly output of -o 1 and -o 3 (optimization flag). I do not remember which architecture, might have been Sun OS workstations, there was a delay of 1 cycle before a jump to a function, so without optimization it would be:

1. put parameters of the function in the stack
2. jump to the function subtroutine
3. nop (wait until the subtroutine actually runs)
4. get the values back

With optimization on it will switch steps 1 and 2, and skip 3... which looked very weird to me, but saves 1 cycle.
I then managed to make code that ran without optimizations, and locked the machine with... (my faulty code)
 

LWFlouisa

Newbie
Joined
May 6, 2018
Messages
15
Age
30
Just what I was looking for. I'm growing a certain appreciation for 8 bit systems.
 
Top