Skip to content

Commit

Permalink
perf: Refactor the internal Value data structure and make some perfor…
Browse files Browse the repository at this point in the history
…mance improvements (#245)

This PR refactors the internal Value data structure that is used to hold
a loaded or an unloaded map value. Previous we had stored `Rc<Enum>`-s
where `Enum` was either a loaded value (`Vec<u8>`) or an unloaded value
(`offset: Bytes`). The new representation stores a `OnceCell` inside the
enum so we no longer need `Rc`.

The new representation makes it possible to hand out plain references to
the loaded values (whereas a special `Ref` wrapper was necessary
previously). Using this, we can optimize some of the code paths leading
to good performance gains.
  • Loading branch information
frankdavid authored Nov 20, 2024
1 parent 0814d4b commit 8c75149
Show file tree
Hide file tree
Showing 7 changed files with 200 additions and 175 deletions.
Loading

0 comments on commit 8c75149

Please sign in to comment.