1.2和1.1比速度变化

为什么我感觉v1.2要比v1.1速度慢了呢,下面是写的一个算法,同样运行10遍的结果
julia 1.2下运行

julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

julia> @time for i in 1:10  fireinthehole(opt) end
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 304 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 298 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 299 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 296 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 299 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 298 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 299 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 300 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 300 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 299 milliseconds passed.  ✌
  2.996394 seconds (107.79 M allocations: 4.371 GiB, 15.99% gc time)

julia 1.1.1下运行

julia> versioninfo()
Julia Version 1.1.1
Commit 55e36cc308 (2019-05-16 04:10 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

julia> @time for i in 1:10  fireinthehole(opt) end
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 282 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 276 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 277 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 281 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 277 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 282 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 285 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 280 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 282 milliseconds passed.  ✌
[ Info: MOEADDE is running ✈ ✈ ✈ ✈ ✈ ✈ ...
[ Info: Finished, 282 milliseconds passed.  ✌
  2.806100 seconds (107.87 M allocations: 4.376 GiB, 15.95% gc time)

对于我写的这个算法来说,1.2比1.1.1慢了将近20毫秒. 这是1.2有新的语法限制还是其他变化?

楼主,能看一下你的算法吗?

楼主是哪国空军:roll_eyes:

:joy:这只是一个简单的实现

:sweat_smile:

请给出完整代码,以及请正确使用分类标签。这不是心得和体会。

1 个赞