Re: crc tests: Add a benchmark program

2024-10-16 Thread Sam Russell
Thank you for including explicit usage cmdline :) Results with current slice_by_8 code GL_CRC_SLICE_BY_8 not set $ gltests/bench-crc 100 real 7.502692 user 7.503 sys0.000 $ gltests/bench-crc 100 real 7.481411 user 7.481 sys0.000 $ gltests/bench-crc 100 real 7.525393

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Simon Josefsson via Gnulib discussion list
Bruno Haible via Gnulib discussion list writes: > Simon Josefsson wrote: >> I think in this example, I think it makes >> sense for gnulib to provide a optimized CRC function that may contain >> architecture-specific optimizations. The reason seems to be that while >> there are numerous different

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Bruno Haible via Gnulib discussion list
Simon Josefsson wrote: > I think in this example, I think it makes > sense for gnulib to provide a optimized CRC function that may contain > architecture-specific optimizations. The reason seems to be that while > there are numerous different optimized implementations around, few seems > to be arr

crc tests: Add a benchmark program

2024-10-16 Thread Bruno Haible via Gnulib discussion list
In preparation of Sam's improvements to the 'crc' module, it will be useful to have a benchmark program, so that we can measure the speedups on various CPUs. I'm committing this patch. To use it: $ ./gnulib-tool --create-testdir --dir=../testdir --single-configure --symlink crc $ cd ../testdi

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Simon Josefsson via Gnulib discussion list
Kristoffer Brånemyr writes: > Which CRC version did you plan to put into gnulib by the way? There > are many different polynomials in use. CRC32 and CRC32C for instance > use different polynomials. I don't remember which polynomial the > routine in cksum used, but I think it was CRC32, but I seem

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Kristoffer Brånemyr
Den tisdag 15 oktober 2024 kl. 13:05:53 CEST, Pádraig Brady skrev: >On 15/10/2024 08:07, Simon Josefsson wrote: > > The coreutils code is GPL and the crc module in gnulib is LGPL.  I'm > > using the gnulib crc module in some LGPL projects.  Is it wortwhile to > > keep the optimization GPL?  I w

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Kristoffer Brånemyr
Den onsdag 16 oktober 2024 kl. 08:43:03 CEST, Simon Josefsson skrev: > Pádraig Brady writes: > > > >  In general gnulib focuses on portable routines, so for example leaves > > platform specific crypto optimizations to libcrypto, only providing fallback > > cross platform implementations wher

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-16 Thread Simon Josefsson via Gnulib discussion list
Sam Russell writes: >> People using the crc module who want to disable the faster/larger CRC32 >> implementation can add 'gl_crc_slice_by_8=yes' to their configure.ac >> before invoking gnulib. > > I've been running tests with `./gnulib-tool --with-tests --test crc` so I'm > interested in a way o

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-16 Thread Sam Russell
> How about adding something like this to modules/crc: Done > People using the crc module who want to disable the faster/larger CRC32 > implementation can add 'gl_crc_slice_by_8=yes' to their configure.ac > before invoking gnulib. I've been running tests with `./gnulib-tool --with-tests --test

Re: Test for pthread_rwlock_init() always passes, regardless

2024-10-16 Thread Bruno Haible via Gnulib discussion list
Sevan Janiyan wrote in https://lists.gnu.org/archive/html/bug-gnulib/2023-11/msg00163.html https://lists.gnu.org/archive/html/bug-gnulib/2023-11/msg00165.html https://lists.gnu.org/archive/html/bug-gnulib/2023-11/msg00183.html : > All pthread components in gnulib > should be bundled? > > test-pth

Re: [PATCH 0/2] use AM_TESTS_ENVIRONMENT Automake variable

2024-10-16 Thread Bruno Haible via Gnulib discussion list
Hi, Mathieu Lirzin wrote in : > Hello, > > Since 2011 Automake TESTS_ENVIRONMENT variable is reserved for the > user unless the “older (and discouraged) serial test harness” is used. > See: > > > https://www.gnu.org/software

Re: Adding slice-by-4 and slice-by-8 to CRC32

2024-10-16 Thread Sam Russell
> I seem to remember there was something special with the polynomial that forced you byteswap the data. That's correct, coreutils uses the normal polynomial, gnulib uses the bit-reversed polynomial, and gzip uses gnulib directly as the RFC 1952 specifies the bit-reversed polynomial. Both use the s

Re: [PATCH] crc: New optimised slice-by-8 implementation

2024-10-16 Thread Simon Josefsson via Gnulib discussion list
Sam Russell writes: > This is my implementation of the slice-by-8 algorithm for CRC32 generation. Thanks! > I've added a flag CRC_ENABLE_SLICE_BY_8, I'd appreciate if someone can give > me a hint on how to set this up in the makefile config. I get the > impression that we want this to be on by