Optimize Value<T>

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
backend

Research direction

Start by reading the existing Rc implementation and the linked Rust documentation for UniqueRc. Investigate how strong and weak references are represented and how the proposed single allocation could preserve the alive check. Done means a dedicated type reduces Value<T> overhead while retaining the required weak reference behavior.

Written by the indexing model from the issue text.

Description

performance

Our Rc always has strong count of 0 or 1 + potentially weak references.
We should try hand rolling a dedicated type that reduces overhead. We only need 1 bit for checking if the object is alive or not (steal it from the weak counter). Plus a single allocation.

Check https://doc.rust-lang.org/std/rc/struct.UniqueRc.html

Dominant language
Rust
Stars
310
Forks
18
Avg merge
10h 18m
Merged PRs (30d)
125

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Cpp2Rust/cpp2rust

All issues in Cpp2Rust/cpp2rust

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.