title: Why do these two pieces of Julia code perform so differently?
body: <pre><code>function c1()
          x::UInt64 = 0
          while x&lt;= (10^8 * 10)
                  x+=1
          end
  end
  
  function c2()
          x::UInt64 = 0
          while x&lt;= (10^9)
                  x+=1
          end
  end
  
  function c3()
          x::UInt64 = 0
          y::UInt64 = 10^8 * 10
          while x&lt;= y
                  x+=1
          end
  end
  
  function c4()
          x::UInt64 = 0
          y::UInt64 = 10^9
          while x&lt;= y
                  x+=1
          end
  end
  </code></pre>
  
  <p>Should be the same, right?</p>
  
  <pre><code>@time c1()
  
  0.019102 seconds (40.99 k allocations: 2.313 MiB)
  
  @time c1()
  
  0.000003 seconds (4 allocations: 160 bytes)
  
  @time c2()
  
  9.205925 seconds (47.89 k allocations: 2.750 MiB)
  
  @time c2()
  
  9.015212 seconds (4 allocations: 160 bytes)
  
  @time c3()
  
  0.019848 seconds (39.23 k allocations: 2.205 MiB)
  
  @time c3()
  
  0.000003 seconds (4 allocations: 160 bytes)
  
  @time c4()
  
  0.705712 seconds (47.41 k allocations: 2.719 MiB)
  
  @time c4()
  
  0.760354 seconds (4 allocations: 160 bytes)
  </code></pre>