Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Julia 0.3.1 slow startup on win64 (no sys.dll) #8724

Closed
mmagnuski opened this issue Oct 18, 2014 · 25 comments
Closed

Julia 0.3.1 slow startup on win64 (no sys.dll) #8724

mmagnuski opened this issue Oct 18, 2014 · 25 comments
Labels
system:windows Affects only Windows

Comments

@mmagnuski
Copy link

I usually have to wait about 12 - 16 seconds for the Julia interpreter to start.
I'm not sure if this is normal on Windows but seeing startup times of about 2 - 3 seconds posted by linux users in your issues (for example in #260) I thought it is a bit weird.

below is a cleared-up ouput from Measure-Command in PowerShell running julia -e 0:

PS C:\Users\Mikuś> Measure-Command {julia -e 0}

Seconds           : 13
Milliseconds      : 642
Ticks             : 136426765
TotalSeconds      : 13,6426765
TotalMilliseconds : 13642,6765

I'd be happy to give you more info if needed.

@pao
Copy link
Member

pao commented Oct 18, 2014

Mostly this is because we don't ship a precompiled sys.dll on Windows, as explained in this comment. Hopefully this will be fixed in a future release backed by a later version of LLVM.

I'm not sure if we have an issue tracking bringing sys.dll back--I couldn't find one. Maybe this should be it? @tkelman, thoughts?

@pao pao added the system:windows Affects only Windows label Oct 18, 2014
@mmagnuski
Copy link
Author

Thanks for the explanation!

@PythonNut
Copy link
Contributor

Oddly, I just ran julia in a windows 8 VirtualBox VM, and julia started very fast (<1s). Does running a dev build improve things for you?

@pao
Copy link
Member

pao commented Oct 19, 2014

If you're building your own build, @PythonNut, you probably have a sys.dll (unless you delete it). It's explicitly removed from the binaries that we distribute.

@PythonNut
Copy link
Contributor

Ah, that explains it.

@tkelman
Copy link
Contributor

tkelman commented Oct 19, 2014

@pao nice searching. I agree with past me (not always the case) - not much has changed since July, LLVM 3.5.0 was released last month but my understanding is some of Keno's patches that we require were reverted so we're still on 3.3 for a while longer.

@staticfloat
Copy link
Member

Yes, last I heard (beginning of September) was that we will either have to ship a patched LLVM 3.5 (e.g. no using distribution packages) or wait until 3.6. So far, we're waiting for 3.6.

@mmagnuski
Copy link
Author

When is LLVM 3.6 expected to be released?

@pao pao changed the title Julia 0.3.1 slow startup on windows 8 Julia 0.3.1 slow startup on windows (no sys.dll) Oct 19, 2014
@pao
Copy link
Member

pao commented Oct 19, 2014

e.g. no using distribution packages

Would it make sense to use LLVM 3.5 patched for just the Windows build, where this doesn't matter? Or are we worried about fragmenting over multiple LLVM versions?

@tkelman
Copy link
Contributor

tkelman commented Oct 19, 2014

We have Windows-only patches for LLVM 3.3 already, and several more for non-Windows too. Patches are slightly annoying but sometimes they're the best way to get things done quickly. For LLVM 3.5 I don't have the slightest idea what patches are required. The backtrace unit test actually goes from failing on LLVM 3.3 (Julia master) to passing with 3.5.0, but the numbers tests start failing #7728 (comment). Haven't looked in depth into the sys.dll issues yet, and apparently things are messed-up on Mac too.

@vtjnash
Copy link
Member

vtjnash commented Oct 24, 2014

I can't compile julia on win64 yet (sysimg doesn't build), although win32 target seems to be working.

@Keno any idea where the MCJIT emits the .eh_frame (if it even does)

@vtjnash
Copy link
Member

vtjnash commented Oct 25, 2014

@tkelman it seems that julia w/ 3.5.0 crashes at startup if I don't have a sys.dll image to bootstrap with. what do you get for your configuration target:

$ ./usr/bin/llvm-config.exe --host-target
x86_64-w64-windows-gnu

@tkelman
Copy link
Contributor

tkelman commented Oct 25, 2014

@vtjnash I get the same output for --host-target. I don't have compiled dependencies using mingw-builds handy - @ihnorton or @quinnj do you? I'm thinking it's a compiler version problem.

@ihnorton
Copy link
Member

Same, x86_64-w64-windows-gnu

On Fri, Oct 24, 2014 at 8:24 PM, Tony Kelman [email protected]
wrote:

@vtjnash https://github.com/vtjnash I get the same. I don't have
compiled dependencies using mingw-builds handy - @ihnorton
https://github.com/ihnorton or @quinnj https://github.com/quinnj do
you? I'm thinking it's a compiler version problem.


Reply to this email directly or view it on GitHub
#8724 (comment).

@tkelman
Copy link
Contributor

tkelman commented Oct 25, 2014

@ihnorton I should've elaborated - what I was asking was do you also see Win64 Julia using mingw-builds and LLVM 3.5.0 crash at startup?

@tkelman
Copy link
Contributor

tkelman commented Oct 25, 2014

My Windows builds for several months have all been cross-compiles from either Cygwin or Linux. In Cygwin the set of packages you need to build Julia is:

  • git
  • make
  • curl
  • patch
  • python
  • gcc-g++
  • m4
  • p7zip
  • mingw64-x86_64-gcc-g++ (replace x86_64 with i686 for 32 bit)
  • mingw64-x86_64-gcc-fortran (replace x86_64 with i686 for 32 bit)

plus dependencies, and setting XC_HOST in Make.user. It works as well or better than MSYS2 in my opinion, and is able to start fine with LLVM 3.5.0, though fails the numbers test.

@ihnorton
Copy link
Member

Yes, I see the crash with both 3.5 and llvm trunk (gcc x64-4.8.1-win32-seh-rev5)

@tkelman
Copy link
Contributor

tkelman commented Oct 25, 2014

Thanks for confirming. Looks like we'll have to switch recommended Windows build configuration then? Any reasons not to make Cygwin cross-compile the main source build method for Windows (assuming people other than me can get it to work)? Now I'll really have to rewrite README.windows.md, I was hoping I could just add "here's another option" but apparently it'll be more of a replacement.

If we make that switch then it'll be good to put in some error-quickly bits into the makefile to prevent people from trying to use Cygwin's gcc - same issue as the msys gcc, it can't build libuv. The MinGW cross compilers work well though, and you get them from the same setup program as the rest of Cygwin which makes things simpler to install.

@ihnorton
Copy link
Member

Looks like we'll have to switch recommended Windows build configuration then?

It would be nice to get a sense of why it is broken before doing that.

string.jl

Program received signal SIGSEGV, Segmentation fault.
0x0000000070b9234f in jl_apply_generic (F=0x7a00000061, args=0xd3df00,
    nargs=2) at gf.c:1591
1591        jl_methtable_t *mt = jl_gf_mtable(F);
(gdb) bt
#0  0x0000000070b9234f in jl_apply_generic (F=0x7a00000061, args=0xd3df00,
    nargs=2) at gf.c:1591
#1  0x000000001ce602f5 in julia_mapfoldl_impl3321 ()
#2  0x000000001ce60068 in jlcall_mapfoldl_impl3321 ()
#3  0x0000000070b96efe in jl_apply (f=0xf17d190, args=0xd3e238, nargs=5)
    at julia.h:978
#4  0x0000000070b9a430 in jl_trampoline (F=0xf17d190, args=0xd3e238, nargs=5)
    at builtins.c:829
#5  0x0000000070b8d4e8 in jl_apply (f=0xf17d190, args=0xd3e238, nargs=5)
    at julia.h:978
#6  0x0000000070b9256d in jl_apply_generic (F=0x7c39570, args=0xd3e238,
    nargs=5) at gf.c:1642
#7  0x000000001ce20216 in julia_mapfoldl3317 ()
#8  0x000000001ce2004c in jlcall_mapfoldl3317 ()
#9  0x0000000070b96efe in jl_apply (f=0xe5a62b0, args=0xd3e558, nargs=3)
    at julia.h:978
#10 0x0000000070b9a430 in jl_trampoline (F=0xe5a62b0, args=0xd3e558, nargs=3)
    at builtins.c:829

@vtjnash what is the issue with .eh_frame?

@tkelman
Copy link
Contributor

tkelman commented Oct 25, 2014

It would be nice to get a sense of why it is broken before doing that.

Yeah, good point. If fixable without changing build configuration then we should try to fix it.

what is the issue with .eh_frame?

There was a question of whether any SEH instructions get emitted with LLVM 3.5, I think. The answer looked like no? https://gist.github.com/tkelman/06dc5a277b2418697463

Some things Jameson said in IRC last night that I made sure to write down:

the most straightforward is to just add the code to our custom JITMemoryManager to handle overallocating code sections
then factor the code in NotifyFunctionEmitted so that it can be called from the iter in NotifyObjectEmitted

I understood some of those words. You might understand more of them.

@vtjnash vtjnash changed the title Julia 0.3.1 slow startup on windows (no sys.dll) Julia 0.3.1 slow startup on win64 (no sys.dll) Dec 13, 2014
@vtjnash
Copy link
Member

vtjnash commented Dec 13, 2014

this is confirmed fixed by turning on LLVM35 (or later)

@vtjnash vtjnash closed this as completed Dec 13, 2014
@tkelman
Copy link
Contributor

tkelman commented Dec 13, 2014

@vtjnash does it somehow pass the numbers test now? #7728 (comment)

@vtjnash
Copy link
Member

vtjnash commented Dec 13, 2014

who said anything about a numbers test?

this issue was just about being faster.

i just kicked off a rebuild (to sync up with recent changes in master), so it'll be a very long time before before I can run the full test suite.

  | | |_| | | | (_| |  |  Version 0.4.0-dev+1908 (2014-12-01 20:43 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 5f23e22* (11 days old master)
|__/                   |  x86_64-w64-mingw32

julia> fld(0.25, -1)
-1.0

julia> fld(promote(0.25, -1)...)
-1.0

@tkelman
Copy link
Contributor

tkelman commented Dec 13, 2014

Me, because I'm curious if anything has changed to somehow make llvm 3.5 work better. Even on 3.3 sys.dll gives faster startup and has all year, so fast startup isn't the entire issue.

@vtjnash
Copy link
Member

vtjnash commented Dec 13, 2014

sure, but it broke backtraces and reliable exception handling.

i was going to wait for the tests to run to push, but I guess there's no real need to: e00f0d9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
system:windows Affects only Windows
Projects
None yet
Development

No branches or pull requests

7 participants