You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, loading an integer always takes 5 bytes. one byte to warn the interpreter that the next 4 bytes encode an integer, and then those 4 bytes of integer.
Looking at the code being produced by our compiler, we spend a lot of time referencing
functions
global variables
local variables
and for each of these things, we need to reference them by using integers.
We tend to use the integers from 0-16 with high frequency.
So I want to add:
36 opcodes to load an integer from 0-35. so we can encode 0-35 in 1 byte.
1 opcode to indicate that the next byte is an integer. so we can encode 0-255 in 2 bytes.
1 opcode to indicate that the next 2 bytes are an integer. so we can encode 0-65535 in 3 bytes.
Historically speaking, bitcoin has opcodes to load the integers from 0-15 in one byte.
Looking at the smart contracts I have already written, and the bytecode being produced by the current version of the compiler, it seems like this update would reduce the size of the typical contract by about 1/2.
The text was updated successfully, but these errors were encountered:
Currently, loading an integer always takes 5 bytes. one byte to warn the interpreter that the next 4 bytes encode an integer, and then those 4 bytes of integer.
Looking at the code being produced by our compiler, we spend a lot of time referencing
and for each of these things, we need to reference them by using integers.
We tend to use the integers from 0-16 with high frequency.
So I want to add:
36 opcodes to load an integer from 0-35. so we can encode 0-35 in 1 byte.
1 opcode to indicate that the next byte is an integer. so we can encode 0-255 in 2 bytes.
1 opcode to indicate that the next 2 bytes are an integer. so we can encode 0-65535 in 3 bytes.
Historically speaking, bitcoin has opcodes to load the integers from 0-15 in one byte.
Looking at the smart contracts I have already written, and the bytecode being produced by the current version of the compiler, it seems like this update would reduce the size of the typical contract by about 1/2.
The text was updated successfully, but these errors were encountered: