-
Notifications
You must be signed in to change notification settings - Fork 256
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
Add support for Rust v0 symbol mangling scheme #474
Comments
@jlfwong any thoughts on this ? If I understand correctly, the current C++ demangling support is a javascript (non WASM) emscripten compiled version of I see 2 options for supporting Rust symbol demangling:
Would you be interesting in a PR using this implementation ? I was also wondering what you would think of targeting WASM instead, as today the |
Another potential solution would be to use a single demangling function compiled into Javascript or WASM that would be using |
Hey @cerisier, I'm open to a PR that implements this. Between the solutions you're describing, the thing I'd like to do is whatever...
Right now the C++ demangling code is ~160kB. I added that a long time ago, so I suspect I was choosing the path of least resistance there, and adding a minified JS ball was just really easy. If adding a wasm module is significantly smaller than that, and could be done without adding a huge dependency chain, I'd be open to it. Can you help me understand what the tradeoffs between the approaches you're describing are in terms of resulting code? |
Thanks for your answer !
Understood. That said, even if the
Understood, I'll suggest an approach that keeps optimizes for bundle size and if possible, adds nothing to the initial load, keeping everything lazy loaded and async.
I'll dig more into that and suggest the best of the 2 options with regards to the 2 important points above. Out of curiosity, do you remember the process you used to get to that JS blob ?
That would help me figure out the best approach to fit with the existing.
Sure, I believe there are several options possible:
I think it's probably best to forget the I was also thinking of documenting the process along the way so that further improvements are easier to make. |
That approach sounds good to me! Re: how the JS ball was made, I don't remember, but a bit of code archeology from #2 suggests https://github.com/nattofriends/c-filtjs which may have the actual build commands used. The URL referenced in a comment in the code is dead, but the internet archive link should work: https://web.archive.org/web/20200808121129/https://d.fuqu.jp/c++filtjs/ |
@jlfwong I just made a draft PR following our discussion. Before I spend time making a proper PR description, I wanted to get your opinion on how/where to include the C source code as well as compilation instructions. The approach I used compiles What's your POV on this? A dedicated |
@cerisier I think keeping it as close spatially as possible to the resulting code appeals to me, so a |
@jlfwong PR is ready 👌 |
Rust has defined its own symbol mangling scheme (https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html) which is currently not supported since it differs completely from the C++ name mangling scheme speedscope already support.
Would you accept a Pull Request to bring this support to Speedscope ?
The text was updated successfully, but these errors were encountered: