commander@lemmings.world to Rust Programming@lemmy.mlEnglish · edit-22 days agoWhich is faster?message-squaremessage-square12fedilinkarrow-up19arrow-down12file-text
arrow-up17arrow-down1message-squareWhich is faster?commander@lemmings.world to Rust Programming@lemmy.mlEnglish · edit-22 days agomessage-square12fedilinkfile-text
minus-squareGiooschi@lemmy.worldlinkfedilinkEnglisharrow-up3·edit-212 hours ago let statements only reserves space on the stack It is not guaranteed to do that. It could also use a register or be optimized out completly (like in the example you posted in the other comment). The stack pointer is also not changed for each local variable, but instead for each function call, so it wouldn’t make a difference anyway.
It is not guaranteed to do that. It could also use a register or be optimized out completly (like in the example you posted in the other comment).
The stack pointer is also not changed for each local variable, but instead for each function call, so it wouldn’t make a difference anyway.
Ok! Thanks for the clarification !