dwavesystems / dwavesystems/dimod

Make shapeablebqm's more performant.

Open
#585 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
143
Forks
91
Avg merge
1h 24m
Merged PRs (30d)
3

Description

**Application**
This is actually a review for an already-merged patch, but it's a low priority.

**Proposed Solution**
1. many methods should be defined with `cpdef` and their return values typed. Or to be even more opinionated with disregard to work required: there each method should have a `_c` version that's `cdef`'d, with a thin `def` wrapper. Alternatively, do the entire class in templated C++ and let the cython code bit be a very thin wrapper.
2. both `change_vartype(...,inplace=False)` and `_init_bqm` use a copy-and-modify pattern. It would be faster, and more developer effort, to make a copy-constructor which does the modification during construction.

**Alternatives Considered**
Performance gains of these proposals are fairly small; it's probably fine to leave be -- I haven't done any profiling.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.