Since these are just normal integers they will (assuming you are putting 
them in a function) be allocated on the stack so no gc will need to run. 

If x instead allocated something then the previous x would still be in 
memory until the gc desides to clean them up. I'm not sure about the exact 
question but frequent unnecessary allocations can significantly affect 
performance, yes.

On Sunday, May 15, 2016 at 9:55:39 AM UTC+2, Ford Ox wrote:
>
> Just from pure curiosity.
>
> x = 10
> x = 100
> x = x << 2
> x = foo() # returns int64
>
> Will x after any of these instruction use new memory storage (thus there 
> will be two x variables present, until gc deletes the one with no pointer)?
> If yes, does it affect performance significantly?
>
>

Reply via email to