Clang.jl icon indicating copy to clipboard operation
Clang.jl copied to clipboard

`GeneralPrinter` is slow

Open Gnimuc opened this issue 1 year ago • 4 comments

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...

Gnimuc avatar Jun 30 '24 14:06 Gnimuc

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?

JamesWrigley avatar Jul 01 '24 08:07 JamesWrigley

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

Gnimuc avatar Jul 01 '24 11:07 Gnimuc

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

Gnimuc avatar Jul 01 '24 11:07 Gnimuc

I had something similar trying to wrap the win32 API, it took very long but only when I had a lot of entries in printer_blacklist. I then realized it was mostly spent compiling regular expressions, which should be fixed in #518. Could it be what made the printing case so slow here?

serenity4 avatar Nov 28 '24 21:11 serenity4