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

Show --compile with --help (and support better) #36017

Closed
PallHaraldsson opened this issue May 24, 2020 · 9 comments · Fixed by #44223
Closed

Show --compile with --help (and support better) #36017

PallHaraldsson opened this issue May 24, 2020 · 9 comments · Fixed by #44223
Labels
latency Latency

Comments

@PallHaraldsson
Copy link
Contributor

PallHaraldsson commented May 24, 2020

A. Since --compile=min works (even as of 1.6, and I guess all versions since 1.0) and can be MUCH faster (for loading code), show it!

Is there a reason it's undocumented? Are some of of the options dangerous, or other reason undocumented? I believe they are "yes", "no", and "min", and if I recall for pre-1.0 "min" could crash?

B. As with Jeff's new selective lowered optimization trick, being able to get the above option that way would be nice. I'm not sure if that's an easy change, while even I could make a PR for A. unless it's not wanted.

C. Letting the user choose for the new opt option and/or possible B. would be nice, as e.g. @lowopt using Module and even better if possible more granularity, i.e. for functions (loops?).

@JeffBezanson
Copy link
Member

It's not dangerous and should always work (if it crashes or errors unexpectedly, file an issue). But, it can make code run hundreds of times slower, so it's not a practical option in general. It is listed under --help-hidden, but the text there does need more explanation.

We could indeed apply --compile=min at the module level; we should add that. It really is very slow, but still worth experimenting I guess.

@JeffBezanson JeffBezanson added the latency Latency label May 24, 2020
@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented May 27, 2020

I did and Julia's defaults can be 3.7x slower: JuliaInterop/RCall.jl#383 (comment)

And in that case the line (the last one, i.e. not using) which called the wrapper, was even faster on first use, and afterwards as fast as on defaults. This would be good in such situations, or for JLLs.

@derekmahar
Copy link
Contributor

By the way, --compile=min is missing from the Julia 1.4.1 man page.

@blegat
Copy link
Contributor

blegat commented Jan 26, 2021

@derekmahar The option not displayed with --help but it is with --help-hidden:

$ julia --help-hidden
julia [switches] -- [programfile] [args...]
 --compile={yes|no|all|min}Enable or disable JIT compiler, or request exhaustive compilation
 --output-o name           Generate an object file (including system image data)
 --output-ji name          Generate a system image data file (.ji)
 --output-unopt-bc name    Generate unoptimized LLVM bitcode (.bc)
 --output-jit-bc name      Dump all IR generated by the frontend (not including system image)
 --output-bc name          Generate LLVM bitcode (.bc)
 --output-asm name         Generate an assembly file (.s)
 --output-incremental=no   Generate an incremental output file (rather than complete)
 --trace-compile={stdout,stderr}
                           Print precompile statements for methods compiled during execution.

@derekmahar
Copy link
Contributor

derekmahar commented Jan 26, 2021

@blegat, yes, but --help and --help-hidden are not the same as the Julia man page.

@PallHaraldsson
Copy link
Contributor Author

Actually "--help" is in the manual both for current 1.5 and 1.4, but the search feature isn't too good:

https://docs.julialang.org/en/v1/manual/getting-started/

"--help-hidden" isn't there, yes (while can be found from "--help" itself), but in 1.7 manual neither is for that page (I assume just moved and maybe "--help-hidden" is in).

[It's easier to search in a PDF file, and I tracked down an old one for the manual.]

It would be good that the manual is searchable for e.g. "--sysimage" and "--compile-min" too.

@derekmahar
Copy link
Contributor

@blegat @PallHaraldsson

I think you may have misunderstood my point or I was not clear. The option --compile=min is absent from the Julia man page, not the help page.

ubuntu@development1:~$ man julia
.
.
.
       --compile={yes|no|all}
              Enable or disable compiler, or request exhaustive compilation
.
.
.

Note that this differs from the specification of option --compile= present in julia --help-hidden.

@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Jan 29, 2021

Still, for

$ man julia

I already have:

  --compile={yes|no|all|min}
         Enable or disable compiler, or request exhaustive or minimal compilation

I think it's looking at:
/home/pharaldsson_sym/julia-1.6-a0a68a54d6/share/man/man1/julia.1

For some reason the man page still ends with: 2013-12-10

"min" is not in:
/home/pharaldsson_sym/julia-1.5-012b270df6-old/share/man/man1/julia.1

It could be backported to Julia 1.5.4 but I'm not sure really needed, with Julia 1.6 release around the corner.

[I've installed and uninstalled a lot of Julia versions over time. I have 22 Julia installations, from 0.4 to 1.7, plus have used snap install that I do not advice (last I checked it wasn't updated). At first I though man looks only in .deb installs. "It is strongly recommended that the official generic binaries from the downloads page be used to install Julia on Linux and FreeBSD."]

@derekmahar
Copy link
Contributor

Yes, because I reported and fixed #36585. In my earlier comment, I should have written, "The option --compile=min was absent from the Julia man page, not the help page."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
latency Latency
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants