Uh oh!
There was an error while loading. Please reload this page.
proc_macro: stop using LEB128 for RPC. - #59820
Conversation
eddyb
commented
Apr 9, 2019
@bors try |
rust-highfive
commented
Apr 9, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
bors
commented
Apr 9, 2019
⌛ Trying commit 6688b03 with merge 20daaaa5587a335a502951a2e9cd465973bed0a9... |
bors
commented
Apr 9, 2019
☀️ Try build successful - checks-travis |
nnethercote
commented
Apr 9, 2019
@rust-timer build 20daaaa5587a335a502951a2e9cd465973bed0a9 |
rust-timer
commented
Apr 9, 2019
Success: Queued 20daaaa5587a335a502951a2e9cd465973bed0a9 with parent 3750348, comparison URL. |
rust-timer
commented
Apr 10, 2019
Finished benchmarking try commit 20daaaa5587a335a502951a2e9cd465973bed0a9 |
nnethercote
commented
Apr 10, 2019
The comparison URL suggests it's a very slight win. But Cachegrind says it's a big win for
That's an almost 8% reduction. I admit I don't understand why this change causes an improvement... |
nnethercote
commented
Apr 10, 2019
Local profiling results: |
eddyb
commented
Apr 10, 2019
This is a classical "time vs memory" tradeoff: by encoding the original integer's bytes, with no "compression", the CPU has to spend roughly one instruction instead of a loop with several instructions per each 7-bit chunk of the integer, not to mention the branching itself. Because we're only serializing a fixed number of integers per request/response, the memory overhead is tiny and constant, so LEB128 was never really called for. Feel free to approve this PR if you think it helps, or get @alexcrichton to review it, I guess. |
alexcrichton
commented
Apr 10, 2019
I don't mind going either way on this, but I'd be fine waiting for a compelling use case to switch |
nnethercote
commented
Apr 10, 2019
The profiling results above are compelling enough for me. @bors r+ |
bors
commented
Apr 10, 2019
📌 Commit 6688b03 has been approved by |
…cote proc_macro: stop using LEB128 for RPC. I'm not sure how much of an improvement this creates, it's pretty tricky to measure.
Rollup of 8 pull requests Successful merges: - #59781 (Remove check_match from const_eval) - #59820 (proc_macro: stop using LEB128 for RPC.) - #59846 (clarify what the item is in "not a module" error) - #59847 (Error when using `catch` after `try`) - #59859 (Suggest removing `?` to resolve type errors.) - #59862 (Tweak unstable diagnostic output) - #59866 (Recover from missing semicolon based on the found token) - #59892 (Impl RawFd conversion traits for WASI TcpListener, TcpStream and UdpSocket) Failed merges: r? @ghost
fedochet
commented
Apr 24, 2019
@eddyb sorry to bother you so long after this PR is closed, but still: does this change breaks ABI for the procedural macros compiled before this change? |
eddyb
commented
Apr 26, 2019
@fedochet There is no such thing as ABI stability here, Cargo should be recompiling your proc macros for you. |
@eddyb but if I am using precompiled procedural macros and their exported functions outside of compiler and load them by hand (basically to emulate procedural macro expansion)? |
eddyb
commented
Apr 30, 2019
Then you have to emulate what Cargo does and rebuild everything every time the output of |
fedochet
commented
Apr 30, 2019
Is there any chance that proc_macro ABI/API will be stabilized? I've seen a note in the rustc sources that in future procedural macros may be implemented as executables of some sort. They are now in fact, but without reliable ABI it's not safe to use them in external tools (my use case, for example, is providing autocompletion in IDE based on procedural macros expansion) |
eddyb
commented
Apr 30, 2019
@fedochet There are no plans for a stable ABI in Rust. In general, you must recompile everything built by |
fedochet
commented
May 6, 2019
@eddyb please take a look at #60593 - if this problem is real (i hope it's not just on my machine), it is very strange, because you've suggested that I should use the same compiler to compile everything, and from what I'm experiencing it is the only setup that doesn't work (which is, again, very strange) |
I'm not sure how much of an improvement this creates, it's pretty tricky to measure.