perf(qlog): change to Option<Rc<RefCell<Option<SharedStreamer>>>>
Currently qlog is defined as:
```rust
pub struct Qlog {
inner: Rc<RefCell<Option<SharedStreamer>>>,
}
```
https://github.com/mozilla/neqo/issues/1894 documents our finding, that
dereferencing the `Rc<RefCell<_>>` is costly, i.e. showing up in our CPU
profiles.
When writing to the qlog fails, we set the (inner) `Option` to `None`. Thus on
each consecutive logging atttempt we dereference the `Rc<RefCell<_>>` only to
find out that logging is disabled.
This patch still sets the inner `Option` to `None` to inform all other clones of
the `Rc` that logging is disabled. In addition, it introduces an outer `Option`,
which as well is set to `None`, thus avoiding the dereferencing of the
`Rc<RefCell<_>>` on each logging attempt once logging has failed.
---
Fixes https://github.com/mozilla/neqo/issues/1894.
Alternative for https://github.com/mozilla/neqo/pull/3005.
032cd27
24 days ago
by mxinden
+8.63%
Merge branch 'main' into qlog-option
Signed-off-by: Lars Eggert <lars@eggert.org>
8bdce3f
4 days ago
by larseggert
-12.26%
@martinthomson's suggestion
897552e
2 days ago
by larseggert
+4.98%
Update qlog.rs
Co-authored-by: Max Inden <mail@max-inden.de>
Signed-off-by: Lars Eggert <lars@eggert.org>