Skip to content

Enable automatic cpu-dependent dispatch for xxHash#1601

Merged
BareosBot merged 5 commits intobareos:masterfrom
arogge:dev/arogge/master/xxhash-dispatch
Nov 24, 2023
Merged

Enable automatic cpu-dependent dispatch for xxHash#1601
BareosBot merged 5 commits intobareos:masterfrom
arogge:dev/arogge/master/xxhash-dispatch

Conversation

@arogge
Copy link
Member

@arogge arogge commented Nov 17, 2023

This PR enables dynamic dispatch for xxHash on x86-64 (which is the only platform that supports this).
It also adds a benchmark to compare performance of the different digests.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Decision taken that a test is required (if not, then remove this paragraph)
  • The choice of the type of test (unit test or systemtest) is reasonable
  • Testname matches exactly what is being tested
  • On a fail, output of the test leads quickly to the origin of the fault

@arogge arogge force-pushed the dev/arogge/master/xxhash-dispatch branch 7 times, most recently from df6bd9b to e925627 Compare November 20, 2023 11:43
@pstorz pstorz self-requested a review November 20, 2023 12:21
@pstorz pstorz self-assigned this Nov 20, 2023
@pstorz pstorz changed the title Enable automatic cpu-dependant dispatch for xxHash Enable automatic cpu-dependent dispatch for xxHash Nov 20, 2023
@arogge arogge force-pushed the dev/arogge/master/xxhash-dispatch branch 2 times, most recently from d66dcb6 to 76b8b59 Compare November 22, 2023 10:48
@arogge arogge marked this pull request as ready for review November 22, 2023 10:50
@arogge arogge force-pushed the dev/arogge/master/xxhash-dispatch branch from 76b8b59 to 60001e3 Compare November 22, 2023 13:27
@pstorz pstorz force-pushed the dev/arogge/master/xxhash-dispatch branch from 60001e3 to f7e68f4 Compare November 23, 2023 16:50
Previously, we blindly used xxh3.h to have xxhash inlined completely.
While this provides decent performance, we can do better.
Based on wheter using bundled xxhash and the target platform, we
automatically select which header to include to get either the
dynamically linked system-provided library, an optimized algorithm
based on the CPU's features selected at runtime or just the plain
variant of xxhash.

We also configure the bundled xxhash library to be built with -O3.
Previously, if you built Bareos without setting any options yourself,
you would get an unoptimized build. With this patch, if you do not set
any C and C++ compiler flags and also did not select a CMake build-type,
we will automatically set the build-type to RelWithDebInfo (i.e.
some optimizations, but with full debugging symbols).
As we don't want to have assertions disabled in our builds, CMake will
now also filter out the flags -DNDEBUG and /DNDEBUG from all build-type
defaults.
@arogge arogge force-pushed the dev/arogge/master/xxhash-dispatch branch from f7e68f4 to 398c483 Compare November 24, 2023 11:04
@BareosBot BareosBot merged commit 75ca8a3 into bareos:master Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants