News: 0001487041

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Intel Further Speeds Up strnlen() In The GNU C Library For Recent Intel/AMD CPUs

([Intel] 6 Hours Ago Faster strnlen())


Intel software engineers are responsible for many of the great x86_64-related optimizations to the GNU C Library "glibc" over the years. While they've extensively tuned many Glibc functions for achieving peak performance on their modern CPUs, it's a never-ending quest. Merged this week was another optimization to strnlen(), the function for determining the number of bytes in a fixed-size string.

Matthew Sterrett of Intel unified Glibc's strnlen EVEX and EVEX512 implementations. In turn this unified, optimized strnlen handling for x86_64 Intel/AMD CPUs with EVEX support is showing some nice improvements over the prior code.

Sterrett wrote in [1]the commit unifying the strnlen EVEX implementations:

x86: Unifies 'strnlen-evex' and 'strnlen-evex512' implementations.

This commit uses a common implementation 'strnlen-evex-base.S' for both 'strnlen-evex' and 'strnlen-evex512'

This patch serves both to reduce the number of implementations, and it also does some small optimizations that benefit strnlen-evex and strnlen-evex512.

All tests pass on x86.

Benchmarks were taken on [an Intel Core i9 7900X Skylake X CPU].

Geometric mean for strnlen-evex over all benchmarks (N=10) was (new/old) 0.881

Geometric mean for strnlen-evex512 over all benchmarks (N=10) was (new/old) 0.953

That improved code is merged in Glibc Git for the Glibc 2.41 release coming out as stable in February.



[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=294a8927694ed866ffc40833f1b6d96cd649df0a



patrick1946

elbar

uxmkt

Volta

Volta

Netch

patrick1946

patrick1946

markg85

"None of our men are "experts." We have most unfortunately found it necessary
to get rid of a man as soon as he thinks himself an expert -- because no one
ever considers himself expert if he really knows his job. A man who knows a
job sees so much more to be done than he has done, that he is always pressing
forward and never gives up an instant of thought to how good and how efficient
he is. Thinking always ahead, thinking always of trying to do more, brings a
state of mind in which nothing is impossible. The moment one gets into the
"expert" state of mind a great number of things become impossible."
-- From Henry Ford Sr., "My Life and Work," p. 86 (1922):