Skip to content

Conversation

cgutman
Copy link
Collaborator

@cgutman cgutman commented Jan 11, 2023

Description

This PR switches from the Reed-Solomon implementation in moonlight-common-c to a faster one in https://github.com/sleepybishop/nanors

Right now I'm just building with the default autoshim.h flags which means SSSE3 for x86_64 and NEON for aarch64 (since nanors doesn't support runtime CPU feature detection), but that's still good enough for huge performance improvement over the old code.

Screenshot

Profile with old RS implementation:
old_prof

Profile with new RS implementation (sample counts will vary, so just look at the relative values vs WSASendTo):
image

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Branch Updates

LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.

  • I want maintainers to keep my branch updated

@ReenigneArcher
Copy link
Member

Could you also create a PR against the upstream nanors? It doesn't look heavily developed, but maybe they will accept it.

Also, since this is such a minor change... what do you think of still using the upstream nanors and patch it. This would be similar to how we apply patches on build-deps ffmpeg build. Perhaps create a ./third-party/patches directory. Then apply them with:

git apply -v --ignore-whitespace ./third-party/patches/*.patch

Or better yet, that could occur in CMakeLists.txt. https://github.com/LizardByte/build-deps/blob/master/cmake/apply_git_patch.cmake

@cgutman
Copy link
Collaborator Author

cgutman commented Jan 12, 2023

I've submitted the change (with tests) upstream as sleepybishop/nanors#4.

@cgutman
Copy link
Collaborator Author

cgutman commented Jan 13, 2023

The PR was accepted, so I've changed to point back to the upstream repo. This should be ready to merge now.

@ReenigneArcher ReenigneArcher merged commit 5480d3d into LizardByte:nightly Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants