• <i id='WAeTs'><tr id='WAeTs'><dt id='WAeTs'><q id='WAeTs'><span id='WAeTs'><b id='WAeTs'><form id='WAeTs'><ins id='WAeTs'></ins><ul id='WAeTs'></ul><sub id='WAeTs'></sub></form><legend id='WAeTs'></legend><bdo id='WAeTs'><pre id='WAeTs'><center id='WAeTs'></center></pre></bdo></b><th id='WAeTs'></th></span></q></dt></tr></i><div id='WAeTs'><tfoot id='WAeTs'></tfoot><dl id='WAeTs'><fieldset id='WAeTs'></fieldset></dl></div>

  • <tfoot id='WAeTs'></tfoot>
    1. <small id='WAeTs'></small><noframes id='WAeTs'>

      <legend id='WAeTs'><style id='WAeTs'><dir id='WAeTs'><q id='WAeTs'></q></dir></style></legend>

        <bdo id='WAeTs'></bdo><ul id='WAeTs'></ul>

        缓慢的 Julia 启动时间

        Slow Julia Startup Time(缓慢的 Julia 启动时间)
          • <bdo id='SYAO7'></bdo><ul id='SYAO7'></ul>

          • <legend id='SYAO7'><style id='SYAO7'><dir id='SYAO7'><q id='SYAO7'></q></dir></style></legend>

            <small id='SYAO7'></small><noframes id='SYAO7'>

              <tbody id='SYAO7'></tbody>

              <i id='SYAO7'><tr id='SYAO7'><dt id='SYAO7'><q id='SYAO7'><span id='SYAO7'><b id='SYAO7'><form id='SYAO7'><ins id='SYAO7'></ins><ul id='SYAO7'></ul><sub id='SYAO7'></sub></form><legend id='SYAO7'></legend><bdo id='SYAO7'><pre id='SYAO7'><center id='SYAO7'></center></pre></bdo></b><th id='SYAO7'></th></span></q></dt></tr></i><div id='SYAO7'><tfoot id='SYAO7'></tfoot><dl id='SYAO7'><fieldset id='SYAO7'></fieldset></dl></div>

              <tfoot id='SYAO7'></tfoot>

                1. 本文介绍了缓慢的 Julia 启动时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在探索将 Julia 用作通用科学计算语言(而不是 python),但它的启动时间相当缓慢.

                  I am exploring using Julia as a general purpose scientific computing language (as opposed to python), but it's startup time is pretty sluggish.

                  有什么办法可以加快速度?

                  Is there any way of speeding this up?

                  $ time python -c 'print "Hello"'
                  Hello
                  
                  real    0m0.030s
                  user    0m0.018s
                  sys 0m0.010s
                  
                  $ time julia -e 'println("Hello")'
                  Hello
                  
                  real    0m4.614s
                  user    0m4.644s
                  sys 0m0.116s
                  

                  <小时>

                  ADDENDUM:这里是去年 Julia 的一位作者的引述.这个策略有什么困难吗?


                  ADDENDUM: Here is a quote from one of the Julia authors last year. Was there some difficulty with this strategy?

                  大部分 Julia 都是自己编写的,然后经过解析、类型推断和jitted,所以从头开始引导整个系统需要一些时间15-20 秒.为了让它更快,我们有一个分阶段的系统,我们解析、类型推断,然后缓存文件 sys.ji 中类型推断的 AST.然后加载该文件并用于在运行 julia 时运行系统.没有 LLVM 代码或机器但是,代码缓存在 sys.ji 中,因此仍然需要所有 LLVM jitting每次 Julia 启动时都要完成,因此大约需要 2秒.

                  Most of Julia is written in itself, then parsed, type-inferred and jitted, so bootstrapping the entire system from scratch takes some 15-20 seconds. To make it faster, we have a staged system where we parse, type-infer, and then cache a serialized version of the type-inferred AST in the file sys.ji. This file is then loaded and used to run the system when you run julia. No LLVM code or machine code is cached in sys.ji, however, so all the LLVM jitting still needs to be done every time julia starts up, which therefore takes about 2 seconds.

                  这 2 秒的启动延迟非常烦人,我们有一个计划修复它.基本计划是能够编译整个 Julia二进制程序:可以运行的可执行文件或 .so/.dylib可以从其他程序调用的共享库,就好像它们一样只是共享的 C 库.二进制文件的启动时间为与任何其他 C 程序一样,因此 2 秒的启动延迟将消失.

                  This 2-second startup delay is quite annoying and we have a plan for fixing it. The basic plan is to be able to compile whole Julia programs to binaries: either executables that can be run or .so/.dylib shared libraries that can be called from other programs as though they were simply shared C libraries. The startup time for a binary will be like any other C program, so the 2-second startup delay will vanish.

                  推荐答案

                  我在评论中提到的分支现在已合并,并且 julia 比以往任何时候都更适合启动(并且什么都不做).

                  The branch I mentioned in the comment has now been merged and julia is more optimized for startup (and doing nothing), than ever.

                  $> time julia -e 'println("Hello")'
                  Hello
                  
                  real    0m0.622s
                  user    0m1.013s
                  sys     0m0.624s
                  

                  现在可在夜间构建中使用,并将包含在下一个 0.3 版本中.

                  This is now available in the nightly builds, and will be included in the next 0.3 release.

                  这篇关于缓慢的 Julia 启动时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Running .jl file from R or Python(从 R 或 Python 运行 .jl 文件)
                  Running Julia .jl file in python(在 python 中运行 Julia .jl 文件)
                  Using PIP in a Azure WebApp(在 Azure WebApp 中使用 PIP)
                  How to run python3.7 based flask web api on azure(如何在 azure 上运行基于 python3.7 的烧瓶 web api)
                  Azure Python Web App Internal Server Error(Azure Python Web 应用程序内部服务器错误)
                  Run python dlib library on azure app service(在 azure app 服务上运行 python dlib 库)
                  • <bdo id='reMmV'></bdo><ul id='reMmV'></ul>
                  • <tfoot id='reMmV'></tfoot>
                        <i id='reMmV'><tr id='reMmV'><dt id='reMmV'><q id='reMmV'><span id='reMmV'><b id='reMmV'><form id='reMmV'><ins id='reMmV'></ins><ul id='reMmV'></ul><sub id='reMmV'></sub></form><legend id='reMmV'></legend><bdo id='reMmV'><pre id='reMmV'><center id='reMmV'></center></pre></bdo></b><th id='reMmV'></th></span></q></dt></tr></i><div id='reMmV'><tfoot id='reMmV'></tfoot><dl id='reMmV'><fieldset id='reMmV'></fieldset></dl></div>
                        <legend id='reMmV'><style id='reMmV'><dir id='reMmV'><q id='reMmV'></q></dir></style></legend>
                          <tbody id='reMmV'></tbody>

                        <small id='reMmV'></small><noframes id='reMmV'>