Skip to content

Markdown regression on 1.11, probably by 16x (3x for PythonCall) #55706

@PallHaraldsson

Description

@PallHaraldsson

Needs some simple precompile statement (and backport to 1.11 would be great!), then alternative to JuliaLang/Pkg.jl#4015, to fix (3x PythonCall startup regression and) 16x for its dependency JuliaPy/CondaPkg.jl#145

Pkg.REPLMode.gen_help() is slow (makes CondaPkg 16x slower, and therefore PythonCall startup), because of md_str macro taking:

julia> @time Markdown.mdexpr(" ... ")
  1.846971 seconds (794.50 k allocations: 40.745 MiB, 5.85% gc time, 99.96% compilation time)
:($(Expr(:escape, :((Markdown.MD)(Base.getindex(Any, (Markdown.Paragraph)(Base.getindex(Any, "... "))), Dict{Symbol, Any}(:config => Markdown.Config(Function[Markdown.hashheader, Markdown.list, Markdown.fencedcode, Markdown.blockquote, Markdown.admonition], Function[Markdown.blocktex, Markdown.blockinterp, Markdown.indentcode, Markdown.footnote, Markdown.github_table, Markdown.horizontalrule, Markdown.setextheader, Markdown.paragraph], Dict{Char, Vector{Function}}('!' => [Markdown.image], '_' => [Markdown.underscore_bold, Markdown.underscore_italic], '<' => [Markdown.autolink], '`' => [Markdown.inline_code], '*' => [Markdown.asterisk_bold, Markdown.asterisk_italic], '[' => [Markdown.footnote_link, Markdown.link], '\\' => [Markdown.linebreak, Markdown.escapes], '$' => [Markdown.tex, Markdown.interp], '-' => [Markdown.en_dash]))))))))

The ineffective way to time this was:

julia> @time @time md" ... "
  0.000002 seconds (6 allocations: 176 bytes)
  0.013056 seconds (219 allocations: 9.352 KiB, 98.93% compilation time)

also before that, this slow:

julia> @time using Markdown
  0.021316 seconds (8.72 k allocations: 818.078 KiB)

vs. on 1.10:

julia> @time using Markdown
  0.000452 seconds (413 allocations: 44.297 KiB)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions