rust/crates/ra_prof
bors[bot] 5dcd9fdf5e
Merge #2895
2895: Rewrite ra_prof's profile printing r=michalt a=michalt

This changes the way we print things to first construct a mapping from
events to the children and uses that mapping to actually print things.
It should not change the actual output that we produce.

The new approach two benefits:

 * It avoids a potential quadratic behavior of the previous approach.
   For instance, for a vector of N elements:
   ```
   [Message{level: (N - 1)}, ..., Message{level: 1}, Message{level: 0}]
   ```
   we would first do a linear scan to find entry with level 0, then
   another scan to find one with level 1, etc.

 * It makes it much easier to improve the output in the future, because
   we now pre-compute the children for each entry and can easily take
   that into account when printing.

Signed-off-by: Michal Terepeta <michal.terepeta@gmail.com>

Co-authored-by: Michal Terepeta <michal.terepeta@gmail.com>
2020-01-29 20:09:49 +00:00
..
src Merge #2895 2020-01-29 20:09:49 +00:00
Cargo.toml Disable doctests 2019-11-17 18:35:05 +03:00