This is a case of O(2^n). I know what the issue is, at least in my minified case.
Thatās great and I hope your knowledge helps improve performance, however my comment was directed to @DenisKolodin, providing some (hopefully reusable) tips/tools for poking around in the compiler.
Thank you! It's very useful to me. Also I've never listen about DXR before
@huon could you prompt me the handy tool to explore how Rust compiler works inside? I use GDB in terminal, but it's hard to steps through the code. Internal data exploration is tangled. What tool do you use to work with running code? I dream about something like Visual Studio But I admit that another tools can also be handy.
Iām not sure the best way to track that sort of thing. Personally I use the logging statements that are inside it, e.g. RUST_LOG=rustc::middle::traits rustc ...
will cause debug!
and info!
statements inside that module to print during that invocation. I believe getting debug!
statements to print requires compiling a compiler manually, passing --enable-debug-assertions
to ./configure
. (The compilerās RUST_LOG
is similar to that in the external env_logger
crate, but possibly not 100% identical.)
gdb will also work better if you build the compiler yourself and pass --enable-debuginfo
to ./configure
. I believe one can pass both --enable-debug-assertions
and --enable-debuginfo
with the --enable-debug
flag, but youāll probably want to also pass --enable-optimize
to avoid getting a horribly slow compiler. Also, thereās been some unreliabilities with using a debugger on the compiler (and/or with building a compiler for a debugger) in the past, which may still exist.
(./configure
accepts --help
, so you donāt have to remember all the details about the various flags.)
I had no idea that there are more debug options! Thanks for your tips. Itās useful to me.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.