Help with 0.5 slowdown

Ralph,

Thanks for the instructions how to patch this bug. Unfortunately, I am not set up to build Julia from scratch. I obtain Julia via the self-installing .exe files from the download site. So I will wait for a patched version of .0.5 before trying this again.

– Steve

Ah, but that’s exactly what I was aiming to avoid! Perhaps more explanation is in order.

The “system image” is built by Julia itself, and everything it needs is in the self-installing archives. It is a DLL because it contains “precompiled” methods from Base (and Core?) modules - but they are compiled by the same LLVM which is invoked every time you instantiate a Julia method. Here is the link to the instructions.

Incidentally it can help performance to build your own system image (even if you don’t modify Base files) because the compilation can take advantage of the specific features of the CPU in your computer. (I learnt this from @ChrisRackauckas, but I can’t find the reference.)

Last header in this: 7 Julia Gotchas and How to Handle Them - Stochastic Lifestyle

The standard .exe’s are built so that way they work pretty much everywhere. This means they aren’t built to take advantage of the extras that your CPU probably has (things like AVX, fused multiply add (FMA), etc.). So if you really want to test performance, you should either build from source or just run that little piece of code to have it re-build the system image to match your CPU.

@Ralph_Smith,

Thanks for the detailed instructions. Unfortunately, the change is not taking effect, that is, the changes made to operators.jl do not seem to be reflected in the Julia REPL when I restart Julia.

The file I edited is:

c:/Users/vavasis/AppData/Local/Julia-0.5.0/share/julia/base/operators.jl

I tried several variants, including changing the 6-argument version of to_indexes so that it throws an error. I also inserted a dummy function called “iamreallyhere()”.

Then from the REPL of 0.5.0 I used include(..) followed by build_sysimage(force=true). The latter command reported success, and I checked in Windows Explorer that the file

c:/Users/vavasis/AppData/Local/Julia-0.5.0/lib/julia/sys.ji

had a new “Date modified”. Next, I restarted the REPL. But Base.iamreallyhere() gave an undefined function error, and Base.to_indexes(1,1,1,1,1,1) did not throw an error.

One other observation: the date-modified of the file

c:/Users/vavasis/AppData/Local/Julia-0.5.0/lib/julia/sys.dll

was NOT changed. The instructions in the manual aren’t clear on whether building a new system image is supposed to replace this file as well as sys.ji. Possibly I missed a step?

This is mysterious. If I understand correctly, sys.ji is an intermediate towards creating sys.dll
I should admit that (a) I am strictly a Linux user and (b) I have always specified a destination for
build_sysimg rather than try the “force” option. Perhaps Windows wrote the DLL into a file with some other name to avoid clobbering?

I tried using different arguments to build_sysimg() in order to get the files stored elsewhere instead of clobbering the existing files. Alas, no .dll was generated. I got a new .o and .ji file, and I also got inference.o and inference.ji. Any Windows users out there who have rebuilt sys.dll?