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

Precompile Markdown parsing AND printing #55752

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

PallHaraldsson
Copy link
Contributor

@PallHaraldsson PallHaraldsson commented Sep 12, 2024

Improvement on top of #55715, replacing it, to also precompile printing. And then also fixing parsing and using regression for #55706.

@PallHaraldsson
Copy link
Contributor Author

[This shouldn't need a full CI, since a trivial tested add-on.]

This is likely the better backport target for 1.11, assuming it only adds to pkgimage (i.e. not the sysimage), not concerned about bloating it, a bit.

This could precompile a bit more for stdout, not just stderr, but unsure how to do that, also likely not a large improvement. It also misses some tags, for images, not as important, maybe easy to add, but I don't want this to hold up releasing 1.11. Can always be added later...

@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Sep 12, 2024

Julia support the CommonMark extension: https://www.markdownguide.org/extended-syntax/ but is it the only one, e.g. no R Markdown allowed? The parser will not fail at any extension, just ignore it, so might be ok to include here, for later compatibility?

I was looking into what basic tags to add here, and what more, maybe, I see we likely do not support latest 2024 CommonMark https://spec.commonmark.org/0.31.2/changes.html since I found in the code: https://spec.commonmark.org/0.19/#absolute-uri

@KristofferC
Copy link
Sponsor Member

Note that this will precompile many things for

julia> typeof(devnull)
Base.DevNull

which is not the type that will typically be used when printing things.

@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Sep 13, 2024

This is now done.

You can't simply skip devnull, because then it would show, and I'm not sure how to avoid that differently, than I do now.

@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Sep 15, 2024

I think this is now done for the 1.11 backports. Only question is the precompile I got for Markdown (probably harmless to have here; or skip it): precompile(Tuple{typeof(Base.:(^)), String, Int64})

@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Sep 26, 2024

Bump. This was ok for me locally, the CI failure is most likely unrelated, and this can and should be merged, and ideally go into 1.11, since a small better change and this line seems not to be about me:

cd(@__DIR__) do

    Pkg          |           1      1  7m05.9s
    FAILURE
The global RNG seed was 0x6aeb1dca8020ba26586d7a4ba73abb95.
Error in testset Pkg:
Error During Test at none:1
  Got exception outside of a @test
  ProcessExitedException(2)
  Stacktrace:
    [1] try_yieldto(undo::typeof(Base.ensure_rescheduled))
      @ Base ./task.jl:1111
    [2] wait()
      @ Base ./task.jl:1175
    [3] wait(c::Base.GenericCondition{ReentrantLock}; first::Bool)
      @ Base ./condition.jl:141
    [4] wait
      @ ./condition.jl:136 [inlined]
    [5] take_buffered(c::Channel{Any})
      @ Base ./channels.jl:493
    [6] take!(c::Channel{Any})
      @ Base ./channels.jl:487
    [7] take!(::Distributed.RemoteValue)
      @ Distributed /cache/build/tester-amdci5-15/julialang/julia-master/julia-628169b274/share/julia/stdlib/v1.12/Distributed/src/remotecall.jl:726
    [8] remotecall_fetch(::Function, ::Distributed.Worker, ::String, ::Vararg{String}; kwargs::@Kwargs{seed::UInt128})
      @ Distributed /cache/build/tester-amdci5-15/julialang/julia-master/julia-628169b274/share/julia/stdlib/v1.12/Distributed/src/remotecall.jl:461
    [9] remotecall_fetch(::Function, ::Int64, ::String, ::Vararg{String}; kwargs::@Kwargs{seed::UInt128})
      @ Distributed /cache/build/tester-amdci5-15/julialang/julia-master/julia-628169b274/share/julia/stdlib/v1.12/Distributed/src/remotecall.jl:492
   [10] (::var"#46#47"{Vector{Task}, var"#print_testworker_errored#39"{ReentrantLock, Int64, Int64}, var"#print_testworker_stats#36"{ReentrantLock, Int64, Int64, Int64, Int64, Int64, Int64}, Vector{Any}, Dict{String, DateTime}})()
      @ Main /cache/build/tester-amdci5-15/julialang/julia-master/julia-628169b274/share/julia/test/runtests.jl:264
ERROR: LoadError: Test run finished with errors
in expression starting at /cache/build/tester-amdci5-15/julialang/julia-master/julia-628169b274/share/julia/test/runtests.jl:100
ERROR: A test has failed. Please submit a bug report (https://github.com/JuliaLang/julia/issues)

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

Successfully merging this pull request may close these issues.

2 participants