about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2020-10-24 10:42:40 +0200
committerest31 <MTest31@outlook.com>2020-12-07 02:01:21 +0100
commit7208a01cdf8dd23264ac3236012e881402ccbbd5 (patch)
treeb4fd5326de6fa4ef0780c38229bbd6036818ecc2 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent9709ef149c50258b0205995be1dbd99a22a075e0 (diff)
downloadrust-7208a01cdf8dd23264ac3236012e881402ccbbd5.tar.gz
rust-7208a01cdf8dd23264ac3236012e881402ccbbd5.zip
Turn quadratic time on number of impl blocks into linear time
Previously, if you had a lot of inherent impl blocks on a type like:

struct Foo;

impl Foo { fn foo_1() {} }
...
impl Foo { fn foo_100_000() {} }

The compiler would be very slow at processing it, because
an internal algorithm would run in O(n^2), where n is the number
of impl blocks. Now, we add a new algorithm that allocates but
is faster asymptotically.

If there is an overlap between multiple impl blocks in terms of
identifiers, we still run a O(m^2) algorithm on groups of impl
blocks that have overlaps, but that m refers to the size of the
connected component, which is hopefully smaller than the n
that refers to the sum of all connected components.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions