Timeline for Where is the barrier between using uint256 and bytes32?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 12, 2017 at 18:34 | vote | accept | 6egic | ||
Oct 12, 2017 at 18:26 | comment | added | Jesbus |
@ABGhostCoder I do not know. I'm trying to analyze the bytecode produced by the Solidity compiler. It seems that the compiler uses 3 extra instructions to load a bytes32 function parameter, compared to a uint256 . Also, it uses 11 extra instructions to return a bytes32 . With optimizations turned on, these differences disappear completely. I would assume that as the optimizer is improved more and more, bytes32 should eventually be equally expensive as uint256 .
|
|
Oct 12, 2017 at 17:53 | comment | added | 6egic | Thanks Jesse, can you explain why bytes32 is more expensive than uint256 of same size? | |
Oct 12, 2017 at 17:52 | history | edited | Jesbus | CC BY-SA 3.0 |
Added comparison and bitwise operators
|
Oct 12, 2017 at 17:46 | history | answered | Jesbus | CC BY-SA 3.0 |