JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
217 stars 68 forks source link

`GeneralPrinter` is slow #501

Open Gnimuc opened 3 weeks ago

Gnimuc commented 3 weeks ago

It takes almost 1min on my m1 machine to generate only 7k loc: https://github.com/Gnimuc/ClangCompiler.jl/blob/main/lib/17/LibClangEx.jl

whereas, the codegen process only takes seconds...

JamesWrigley commented 3 weeks ago

Anecdotally, I don't think it's ever taken that long to generate the CImGui.jl bindings, which are 14.5k LOC :thinking: Is it just TTFX? Or the printing itself really being slow?

Gnimuc commented 3 weeks ago

I didn't profile but it stuck in "[GeneralPrinter]: print to ..."

Gnimuc commented 3 weeks ago

The LOC of the generated file may not be a good metric because the number of nodes/symbols can be way larger.