Skip to content

Improvements in C++ extensions #70

Description

@IgnacioJPickering

The current state of the C++ extensions (#64) is: They work and they are faster, but the code needs some cleanup

To finalize the extensions at least the following should be done:

  • Refactor all duplicated functions for aligned and non-aligned access using templates
    NOTE: In the end it turned out not refactoring these was the better idea
  • Investigate if it is possible to auto-vectorize (or a manually vectorize) the sums in the similarity calculations (one sum is auto-vectorized, most loops are not)
  • Implement unpacking operations using a LUT
  • Implement packing operations (requires SSE (x86) and NEON (aarch64) instructions) these work well in Linux, with an x86 machine, but they need to be tested on macOS before release. Also the improvements are marginal rn, only use is internally in the centroid calculations, so it may be a good idea to drop this, and the bottleneck is the fact that calc_centroid requires a dynamic dispatch outside C++. Also, there may be alignment issues with the current packing implementation using SSE.
  • Implement the general version of the centroid calculation
  • Test whether they work on macOS | Windows (Currently tested on Linux)
  • Add regression tests for the C++ extensions

None of these are essential, since the extensions already do a pretty good job, but it would be nice to have them.

Metadata

Metadata

Labels

C++Related to C++ extensionsenhancementNew feature or requestlow-priorityTasks with low priority

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions