Consider switching to LLVM-style RTTI for `Node`s and `NodeStateData`

Open
#372 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
performance

Research direction

Start with the linked LLVM-style RTTI guide, then locate the Node and NodeStateData definitions and their current type-checking and casting paths. Evaluate the proposed enum-based approach against the stated speed, memory, and boilerplate trade-offs; done means reaching and documenting an implementation decision.

Written by the indexing model from the issue text.

Description

enhancement

See https://llvm.org/docs/HowToSetUpLLVMStyleRTTI.html

The upshot is keeping an enum of all possible node types and then storing that value on each instantiated object. The benefit is much faster type checking and casting, the downside is a small increase in the memory footprint of each instantiated object. Also a decent amount of boilerplate.

Dominant language
C++
Stars
31
Forks
36
Avg merge
1d 9h
Merged PRs (30d)
4

Contributor guide

Open the contributing guide

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 dwavesystems/dwave-optimization

All issues in dwavesystems/dwave-optimization

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.