[info=dd117a6fc33399c22f6e7352b8796f91ebe3cc436fa84f61556b5e66266b5976]
OBS-URL: https://build.opensuse.org/package/show/science/xxhash?expand=0&rev=33
This commit is contained in:
parent
29e926eee8
commit
a03a4f1d99
10
Makefile
10
Makefile
@ -1,10 +0,0 @@
|
|||||||
SHELL=/bin/bash
|
|
||||||
|
|
||||||
test: xh linux-6.6.1.tar linux-6.6.2.tar linux-6.6.3.tar linux-6.6.4.tar linux-6.6.5.tar
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
|
|
||||||
%.tar:
|
|
||||||
wget -O- https://cdn.kernel.org/pub/linux/kernel/v6.x/$@.xz | xz -cd >$@
|
|
||||||
|
|
||||||
xh: xh.cpp
|
|
||||||
g++ -o xh xh.cpp -lxxhash -Wall -O2 -g
|
|
@ -1,4 +1,4 @@
|
|||||||
mtime: 1735588143
|
mtime: 1735588856
|
||||||
commit: 04f3caff52d71154ac40d11564546762787031b336dcbd4461dd309136fa4cb8
|
commit: dd117a6fc33399c22f6e7352b8796f91ebe3cc436fa84f61556b5e66266b5976
|
||||||
url: https://src.opensuse.org/jengelh/xxhash
|
url: https://src.opensuse.org/jengelh/xxhash
|
||||||
revision: master
|
revision: master
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
version https://git-lfs.github.com/spec/v1
|
||||||
oid sha256:485792ab4096a362be4925eb5030059972f4c96d771fa100bfb0ca37a49a41cc
|
oid sha256:967007efcdc79e20255a1e51f4b7b3d10b70566d4828a904ecaeb252880e7bdd
|
||||||
size 264
|
size 256
|
||||||
|
111
cpu-1135g7
111
cpu-1135g7
@ -1,111 +0,0 @@
|
|||||||
|
|
||||||
=== test ===
|
|
||||||
|
|
||||||
standard openSUSE xxhash packages of today
|
|
||||||
|
|
||||||
$ make
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.24user 6.69system 0:13.69elapsed 72%CPU (0avgtext+0avgdata 3824maxresident)k
|
|
||||||
0inputs+0outputs (0major+178minor)pagefaults 0swaps
|
|
||||||
14:04 f3:../xx/xxhash $ make
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.29user 6.05system 0:13.04elapsed 71%CPU (0avgtext+0avgdata 3720maxresident)k
|
|
||||||
0inputs+0outputs (0major+178minor)pagefaults 0swaps
|
|
||||||
14:05 f3:../xx/xxhash $ make
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.20user 6.29system 0:13.19elapsed 72%CPU (0avgtext+0avgdata 3664maxresident)k
|
|
||||||
0inputs+0outputs (0major+177minor)pagefaults 0swaps
|
|
||||||
14:05 f3:../xx/xxhash $ make
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.38user 5.91system 0:12.89elapsed 72%CPU (0avgtext+0avgdata 3712maxresident)k
|
|
||||||
0inputs+0outputs (0major+178minor)pagefaults 0swaps
|
|
||||||
|
|
||||||
Mean/Spread: 13.20 ± 0.31 sec (2.3% error)
|
|
||||||
|
|
||||||
|
|
||||||
=== switch packages ===
|
|
||||||
|
|
||||||
# rpm -U ...
|
|
||||||
|
|
||||||
|
|
||||||
=== verify AVX512 is now in use ===
|
|
||||||
|
|
||||||
Watch this space closely.
|
|
||||||
|
|
||||||
$ gdb xh
|
|
||||||
Reading symbols from xh...
|
|
||||||
(gdb) b main
|
|
||||||
Breakpoint 1 at 0x4010b0: file xh.cpp, line 7.
|
|
||||||
(gdb) r <xh.cpp
|
|
||||||
Starting program: /home/jengelh/obs_nosave/zu/home/jengelh/xx/xxhash/xh <xh.cpp
|
|
||||||
[Thread debugging using libthread_db enabled]
|
|
||||||
Using host libthread_db library "/lib64/libthread_db.so.1".
|
|
||||||
|
|
||||||
Breakpoint 1, main () at xh.cpp:7
|
|
||||||
7 auto state = XXH3_createState();
|
|
||||||
(gdb) b XXH_setDispatch
|
|
||||||
Breakpoint 2 at 0x7ffff7f9a6f4: file /usr/src/debug/xxHash-0.8.2/xxh_x86dispatch.c, line 706.
|
|
||||||
(gdb) r
|
|
||||||
Restart?-yes
|
|
||||||
Starting program: /home/jengelh/obs_nosave/zu/home/jengelh/xx/xxhash/xh <xh.cpp
|
|
||||||
[Thread debugging using libthread_db enabled]
|
|
||||||
Using host libthread_db library "/lib64/libthread_db.so.1".
|
|
||||||
|
|
||||||
Breakpoint 2, XXH_setDispatch () at /usr/src/debug/xxHash-0.8.2/xxh_x86dispatch.c:706
|
|
||||||
706 {
|
|
||||||
(gdb) bt
|
|
||||||
#0 XXH_setDispatch () at /usr/src/debug/xxHash-0.8.2/xxh_x86dispatch.c:706
|
|
||||||
#1 0x00007ffff7fca53e in call_init (env=0x7fffffffd998, argv=0x7fffffffd988, argc=1, l=<optimized out>) at dl-init.c:74
|
|
||||||
#2 call_init (l=<optimized out>, argc=1, argv=0x7fffffffd988, env=0x7fffffffd998) at dl-init.c:26
|
|
||||||
#3 0x00007ffff7fca63c in _dl_init (main_map=0x7ffff7fbe000, argc=1, argv=0x7fffffffd988, env=0x7fffffffd998) at dl-init.c:121
|
|
||||||
#4 0x00007ffff7fe2ba0 in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
|
|
||||||
#5 0x0000000000000001 in ?? ()
|
|
||||||
#6 0x00007fffffffde8c in ?? ()
|
|
||||||
#7 0x0000000000000000 in ?? ()
|
|
||||||
(gdb) n
|
|
||||||
707 int vecID = XXH_featureTest();
|
|
||||||
(gdb)
|
|
||||||
719 XXH_g_dispatch = XXH_kDispatch[vecID];
|
|
||||||
(gdb) p vecID
|
|
||||||
$1 = 3 [= XXH_AVX512!]
|
|
||||||
|
|
||||||
|
|
||||||
=== test ===
|
|
||||||
|
|
||||||
$ make test
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.37user 6.16system 0:13.23elapsed 72%CPU (0avgtext+0avgdata 3708maxresident)k
|
|
||||||
0inputs+0outputs (0major+177minor)pagefaults 0swaps
|
|
||||||
14:07 f3:../xx/xxhash $ make test
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.23user 6.27system 0:13.27elapsed 71%CPU (0avgtext+0avgdata 3664maxresident)k
|
|
||||||
0inputs+0outputs (0major+176minor)pagefaults 0swaps
|
|
||||||
14:07 f3:../xx/xxhash $ make test
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.26user 6.77system 0:13.75elapsed 73%CPU (0avgtext+0avgdata 3712maxresident)k
|
|
||||||
0inputs+0outputs (0major+178minor)pagefaults 0swaps
|
|
||||||
14:07 f3:../xx/xxhash $ make test
|
|
||||||
cat linux-6.*.tar{,,,,,,,} | time ./xh
|
|
||||||
5df8e93736b5a2bddd0b324a455b61fc
|
|
||||||
3.19user 6.07system 0:12.96elapsed 71%CPU (0avgtext+0avgdata 3712maxresident)k
|
|
||||||
0inputs+0outputs (0major+178minor)pagefaults 0swaps
|
|
||||||
|
|
||||||
Mean/Spread: 13.30 ± 0.34s (2.5% error)
|
|
||||||
|
|
||||||
== Lessons learned ==
|
|
||||||
|
|
||||||
Prerequisite for good measurement:
|
|
||||||
* consistent(!) error rate (4 individual measurements is a bit on the low side, but ... anyway)
|
|
||||||
|
|
||||||
Result:
|
|
||||||
* The observed 13.2s mean is within the margin of measurement error of the 13.3 mean and viceversa
|
|
||||||
|
|
||||||
Conclusion:
|
|
||||||
* DISPATCH=1 made no impact on this machine
|
|
14
inline.patch
14
inline.patch
@ -17,16 +17,16 @@ In function 'void XXH3_hashLong_internal_loop(xxh_u64*, const xxh_u8*, size_t, c
|
|||||||
xxhash.h | 2 +-
|
xxhash.h | 2 +-
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
Index: xxHash-0.8.2/xxhash.h
|
Index: xxHash-0.8.3/xxhash.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- xxHash-0.8.2.orig/xxhash.h
|
--- xxHash-0.8.3.orig/xxhash.h
|
||||||
+++ xxHash-0.8.2/xxhash.h
|
+++ xxHash-0.8.3/xxhash.h
|
||||||
@@ -2107,7 +2107,7 @@ static void* XXH_memcpy(void* dest, cons
|
@@ -2421,7 +2421,7 @@ static void* XXH_memcpy(void* dest, cons
|
||||||
# define XXH_NO_INLINE static
|
# define XXH_NO_INLINE static
|
||||||
/* enable inlining hints */
|
/* enable inlining hints */
|
||||||
#elif defined(__GNUC__) || defined(__clang__)
|
#elif defined(__GNUC__) || defined(__clang__)
|
||||||
-# define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused))
|
-# define XXH_FORCE_INLINE static __inline__ __attribute__((__always_inline__, __unused__))
|
||||||
+# define XXH_FORCE_INLINE static __inline__ __attribute__((unused))
|
+# define XXH_FORCE_INLINE static __inline__ __attribute__((__unused__))
|
||||||
# define XXH_NO_INLINE static __attribute__((noinline))
|
# define XXH_NO_INLINE static __attribute__((__noinline__))
|
||||||
#elif defined(_MSC_VER) /* Visual Studio */
|
#elif defined(_MSC_VER) /* Visual Studio */
|
||||||
# define XXH_FORCE_INLINE static __forceinline
|
# define XXH_FORCE_INLINE static __forceinline
|
||||||
|
@ -1,16 +1,22 @@
|
|||||||
From: Bruno Pitrus <brunopitrus@hotmail.com>
|
From: Bruno Pitrus <brunopitrus@hotmail.com>
|
||||||
Date: 2024-05-05 19:35:03+0000
|
Date: 2024-05-05 19:35:03+0000
|
||||||
|
|
||||||
--- xxHash-0.8.2/Makefile.old 2023-07-21 12:01:35.000000000 +0200
|
---
|
||||||
+++ xxHash-0.8.2/Makefile 2024-05-05 21:19:32.265851133 +0200
|
Makefile | 4 ++--
|
||||||
@@ -450,8 +450,8 @@ test-all: test test32 test-unicode clang
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
Index: xxHash-0.8.3/Makefile
|
||||||
|
===================================================================
|
||||||
|
--- xxHash-0.8.3.orig/Makefile
|
||||||
|
+++ xxHash-0.8.3/Makefile
|
||||||
|
@@ -483,8 +483,8 @@ test-all: test test32 test-unicode clang
|
||||||
|
|
||||||
.PHONY: test-tools
|
.PHONY: test-tools
|
||||||
test-tools:
|
test-tools:
|
||||||
- CFLAGS=-Werror $(MAKE) -C tests/bench
|
- CFLAGS=-Werror $(MAKE) -C tests/bench
|
||||||
- CFLAGS=-Werror $(MAKE) -C tests/collisions
|
- CFLAGS=-Werror $(MAKE) -C tests/collisions check
|
||||||
+ $(MAKE) -C tests/bench
|
+ $(MAKE) -C tests/bench
|
||||||
+ $(MAKE) -C tests/collisions
|
+ $(MAKE) -C tests/collisions check
|
||||||
|
|
||||||
.PHONY: test-xxh-nnn-sums
|
.PHONY: test-xxh-nnn-sums
|
||||||
test-xxh-nnn-sums: xxhsum_and_links
|
test-xxh-nnn-sums: xxhsum_and_links
|
||||||
|
BIN
v0.8.3.tar.gz
(Stored with Git LFS)
Normal file
BIN
v0.8.3.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
18
xh.cpp
18
xh.cpp
@ -1,18 +0,0 @@
|
|||||||
#include <xxhash.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <cstdio>
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
auto state = XXH3_createState();
|
|
||||||
XXH3_128bits_reset(state);
|
|
||||||
char buffer[1048576];
|
|
||||||
ssize_t count;
|
|
||||||
while ((count = read(STDIN_FILENO, buffer, sizeof(buffer))) > 0)
|
|
||||||
XXH3_128bits_update(state, buffer, count);
|
|
||||||
XXH128_canonical_t canon{};
|
|
||||||
XXH128_canonicalFromHash(&canon, XXH3_128bits_digest(state));
|
|
||||||
for (auto u : canon.digest)
|
|
||||||
printf("%02x", u);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
BIN
xxHash-0.8.2.tar.gz
(Stored with Git LFS)
BIN
xxHash-0.8.2.tar.gz
(Stored with Git LFS)
Binary file not shown.
@ -1,3 +1,12 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Dec 30 19:52:02 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
|
||||||
|
|
||||||
|
- Update to release 0.8.3
|
||||||
|
* Corrects an edge case in ``XXH3_128bits_withSecretandSeed``
|
||||||
|
that could generate invalid results.
|
||||||
|
* xxhash now knows command-line arguments ``--filelist``,
|
||||||
|
``--files-from``.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 3 02:11:09 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
|
Tue Sep 3 02:11:09 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
|
||||||
|
|
||||||
|
48
xxhash.spec
48
xxhash.spec
@ -17,17 +17,18 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: xxhash
|
Name: xxhash
|
||||||
Version: 0.8.2
|
Version: 0.8.3
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Non-cryptographic hash algorithm
|
Summary: Non-cryptographic hash algorithm
|
||||||
License: BSD-2-Clause AND GPL-2.0-only
|
License: BSD-2-Clause AND GPL-2.0-only
|
||||||
Group: Productivity/Security
|
Group: Productivity/Security
|
||||||
URL: https://github.com/Cyan4973/xxHash
|
URL: https://github.com/Cyan4973/xxHash
|
||||||
Source0: https://github.com/Cyan4973/xxHash/archive/v%{version}.tar.gz#/xxHash-%{version}.tar.gz
|
Source: https://github.com/Cyan4973/xxHash/archive/v%version.tar.gz
|
||||||
Patch1: test-tools-do-not-override-cflags.patch
|
Patch1: test-tools-do-not-override-cflags.patch
|
||||||
Patch2: inline.patch
|
Patch2: inline.patch
|
||||||
BuildRequires: gcc-c++
|
BuildRequires: gcc-c++
|
||||||
BuildRequires: pkg-config
|
BuildRequires: pkg-config
|
||||||
|
BuildRequires: time
|
||||||
%{?suse_build_hwcaps_libs}
|
%{?suse_build_hwcaps_libs}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -49,40 +50,37 @@ Hashes are identical on all platforms.
|
|||||||
Summary: Headers for xxHash, a non-cryptographic hash algorithm
|
Summary: Headers for xxHash, a non-cryptographic hash algorithm
|
||||||
License: BSD-2-Clause
|
License: BSD-2-Clause
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: %{name} = %{version}
|
Requires: %name = %version
|
||||||
Requires: libxxhash0 = %{version}
|
Requires: libxxhash0 = %version
|
||||||
|
|
||||||
%description devel
|
%description devel
|
||||||
Headers and other development files for xxHash.
|
Headers and other development files for xxHash.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n xxHash-%{version}
|
%autosetup -p1 -n xxHash-%version
|
||||||
|
|
||||||
%build
|
%build
|
||||||
# ALLOW_AVX just means "we guarantee we policed our %%optflags".
|
# ALLOW_AVX just means "we guarantee we policed our %%optflags".
|
||||||
export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1 -Og"
|
export CFLAGS="%optflags -DXXH_X86DISPATCH_ALLOW_AVX=1"
|
||||||
export CXXFLAGS="$CFLAGS"
|
export CXXFLAGS="$CFLAGS"
|
||||||
export LDFLAGS="%{?build_ldflags}"
|
export LDFLAGS="%{?build_ldflags}"
|
||||||
export DISPATCH=1
|
|
||||||
# DISPATCH=1 if you want AVX2/AVX512. But it does not seem to perform any
|
# DISPATCH=1 if you want AVX2/AVX512. But it does not seem to perform any
|
||||||
# better than the lowest-denomimation code on at least the 1135G7 and 5950X
|
# better than the lowest-denomimation code on at least the 1135G7 and 5950X
|
||||||
# CPUs, and for both LP64 as well as ILP32 — it seems to be all within margin
|
# CPUs, and for both LP64 as well as ILP32 — it seems to be all within margin
|
||||||
# of error.
|
# of error.
|
||||||
%make_build prefix=%{_prefix} libdir=%{_libdir}
|
%make_build prefix=%_prefix libdir=%_libdir
|
||||||
|
|
||||||
%install
|
%install
|
||||||
export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1 -Og"
|
export CFLAGS="%optflags -DXXH_X86DISPATCH_ALLOW_AVX=1"
|
||||||
export CXXFLAGS="%{optflags}"
|
export CXXFLAGS="%optflags"
|
||||||
export LDFLAGS="%{?build_ldflags}"
|
export LDFLAGS="%{?build_ldflags}"
|
||||||
export DISPATCH=1
|
%make_install prefix=%_prefix libdir=%_libdir
|
||||||
%make_install prefix=%{_prefix} libdir=%{_libdir}
|
rm -rf %buildroot%_libdir/libxxhash.a
|
||||||
rm -rf %{buildroot}%{_libdir}/libxxhash.a
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1"
|
export CFLAGS="%optflags"
|
||||||
export CXXFLAGS="%{optflags}"
|
export CXXFLAGS="%optflags"
|
||||||
export LDFLAGS="%{?build_ldflags}"
|
export LDFLAGS="%{?build_ldflags}"
|
||||||
export DISPATCH=1
|
|
||||||
# not safe for parallel execution as it removes xxhash.o and recreates it with different flags
|
# not safe for parallel execution as it removes xxhash.o and recreates it with different flags
|
||||||
# the list is taken from test-all with non-working/irrelevant ones (such as ones that change the toolchain) removed
|
# the list is taken from test-all with non-working/irrelevant ones (such as ones that change the toolchain) removed
|
||||||
%make_build -j1 test test-unicode listL120 trailingWhitespace test-xxh-nnn-sums
|
%make_build -j1 test test-unicode listL120 trailingWhitespace test-xxh-nnn-sums
|
||||||
@ -92,21 +90,15 @@ export DISPATCH=1
|
|||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc README.md
|
%doc README.md
|
||||||
%{_bindir}/xxhsum
|
%_bindir/xxh*
|
||||||
%{_bindir}/xxh32sum
|
%_mandir/man1/xxh*
|
||||||
%{_bindir}/xxh64sum
|
|
||||||
%{_bindir}/xxh128sum
|
|
||||||
%{_mandir}/man1/xxh32sum.*
|
|
||||||
%{_mandir}/man1/xxh64sum.*
|
|
||||||
%{_mandir}/man1/xxh128sum.*
|
|
||||||
%{_mandir}/man1/xxhsum.*
|
|
||||||
|
|
||||||
%files -n libxxhash0
|
%files -n libxxhash0
|
||||||
%{_libdir}/libxxhash.so.*
|
%_libdir/libxxhash.so.*
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_includedir}/*
|
%_includedir/*.h
|
||||||
%{_libdir}/pkgconfig/libxxhash.pc
|
%_libdir/pkgconfig/*.pc
|
||||||
%{_libdir}/libxxhash.so
|
%_libdir/libxxhash.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
Loading…
Reference in New Issue
Block a user