about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-07-17 19:28:23 +0000
committerbors <bors@rust-lang.org>2018-07-17 19:28:23 +0000
commit4f3c7a472b77ba3f3afbc12d004b9d1bbcee7fe7 (patch)
tree5e2753e692856610a816a80af55947e967e77832 /src/libstd/sys/unix/stack_overflow.rs
parent1c84d8187395b641616649a0f16f15a78ea8bbce (diff)
parent0467ae0cf52c47f204cc88a0e851e853ee2bed8f (diff)
downloadrust-4f3c7a472b77ba3f3afbc12d004b9d1bbcee7fe7.tar.gz
rust-4f3c7a472b77ba3f3afbc12d004b9d1bbcee7fe7.zip
Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis
Fix macro parser quadratic complexity in small repeating groups

Observed in #51754, and more easily demonstrated with the following:

```rust
macro_rules! stress {
    ($($t:tt)+) => { };
}

fn main() {
    stress!{
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        //    ... 65536 copies of "a" total ...
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    }
}
```
which takes 50 seconds to compile prior to the fix and <1s after.

I hope this has a visible impact on the compile times for real code.  (I think it is most likely to affect incremental TT munchers that deal with large inputs, though it depends on how they are written)

For a fuller description of the performance issue:  https://github.com/rust-lang/rust/issues/51754#issuecomment-403242159

---

There is no test (yet) because I'm not sure how easily to measure this for regressions.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions