mailing list of musl libc
 help / color / mirror / code / Atom feed
* memchr() performance
@ 2016-09-18 18:54 Georg Sauthoff
  2016-09-18 20:40 ` Rich Felker
  2016-09-18 20:40 ` Szabolcs Nagy
  0 siblings, 2 replies; 7+ messages in thread
From: Georg Sauthoff @ 2016-09-18 18:54 UTC (permalink / raw)
  To: musl

(please CC me as I am not subscribed to this ML)

Hello,

fyi, I've done some benchmarking of different memchr() and std::find()
versions.

I also included the memchr() version from musl.

In general, musl's memchr() implementation doesn't perform better than a
simple unrolled loop (as used in libstdc++ std::find()) - and that is
consistent over different CPU generations and architectures.

On recent Intel CPUs it is even slower than a naive implementation:

https://gms.tf/stdfind-and-memchr-optimizations.html#measurements
https://gms.tf/sparc-and-ppc-find-benchmark-results.html

Of course, on x86, other implementations that use SIMD instructions
perform even better.

Best regards
Georg


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-09-20 17:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-18 18:54 memchr() performance Georg Sauthoff
2016-09-18 20:40 ` Rich Felker
2016-09-18 20:40 ` Szabolcs Nagy
2016-09-19 13:29   ` Georg Sauthoff
2016-09-19 13:37     ` Rich Felker
2016-09-19 17:58     ` Szabolcs Nagy
2016-09-20 17:57       ` Georg Sauthoff

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).