diff options
author | gnn <gnn@FreeBSD.org> | 2015-04-01 04:25:23 +0800 |
---|---|---|
committer | gnn <gnn@FreeBSD.org> | 2015-04-01 04:25:23 +0800 |
commit | 017dc7d42e8d43e9b44ba608983179446f705b8d (patch) | |
tree | 37446a54ebdae08dd6aedd5b410cfd62ca11dead /benchmarks/smhasher | |
parent | b21523cbde7752f921974f660e9d84ad3b1fc1db (diff) | |
download | freebsd-ports-gnome-017dc7d42e8d43e9b44ba608983179446f705b8d.tar.gz freebsd-ports-gnome-017dc7d42e8d43e9b44ba608983179446f705b8d.tar.zst freebsd-ports-gnome-017dc7d42e8d43e9b44ba608983179446f705b8d.zip |
Add SMHasher hashing benchmark and test system as a new port.
SMHasher is a test suite designed to test the distribution, collision,
and performance properties of non-cryptographic hash functions -
it aims to be the "DieHarder" of hash testing, and does a pretty
good job of finding flaws with a number of popular hashes.
The SMHasher suite also includes MurmurHash3, which is the latest
version in the series of MurmurHash functions - the new version is
faster, more robust, and its variants can produce 32- and 128-bit
hash values efficiently on both x86 and x64 platforms.
https://code.google.com/p/smhasher/
Diffstat (limited to 'benchmarks/smhasher')
-rw-r--r-- | benchmarks/smhasher/Makefile | 26 | ||||
-rw-r--r-- | benchmarks/smhasher/distinfo | 2 | ||||
-rw-r--r-- | benchmarks/smhasher/files/patch-smhasher-Platform.cpp | 41 | ||||
-rw-r--r-- | benchmarks/smhasher/files/patch-smhasher-Platform.h | 12 | ||||
-rw-r--r-- | benchmarks/smhasher/pkg-descr | 4 |
5 files changed, 85 insertions, 0 deletions
diff --git a/benchmarks/smhasher/Makefile b/benchmarks/smhasher/Makefile new file mode 100644 index 000000000000..41f318fa3024 --- /dev/null +++ b/benchmarks/smhasher/Makefile @@ -0,0 +1,26 @@ +# Created by: gnn +# $FreeBSD$ + +PORTNAME= smhasher +PORTVERSION= 1.0 +PORTREVISION= 1 +CATEGORIES= benchmarks + +MAINTAINER= gnn@FreeBSD.org +COMMENT= Hash Algorithm Benchmarking + +LICENSE= MIT + +USE_GITHUB= yes +GH_ACCOUNT= gvnn3 +GH_PROJECT= smhasher +DISTVERSIONPREFIX= v + +USES= cmake + +PLIST_FILES= bin/SMHasher + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/SMHasher ${STAGEDIR}${PREFIX}/bin + +.include <bsd.port.mk> diff --git a/benchmarks/smhasher/distinfo b/benchmarks/smhasher/distinfo new file mode 100644 index 000000000000..1631b984f39b --- /dev/null +++ b/benchmarks/smhasher/distinfo @@ -0,0 +1,2 @@ +SHA256 (smhasher-v1.0_GH0.tar.gz) = cd40a370b59446a4a70be0a6399bd9df4944adf6c1854c23dc0ff61fa7011e76 +SIZE (smhasher-v1.0_GH0.tar.gz) = 61909 diff --git a/benchmarks/smhasher/files/patch-smhasher-Platform.cpp b/benchmarks/smhasher/files/patch-smhasher-Platform.cpp new file mode 100644 index 000000000000..f1fd73f87b8a --- /dev/null +++ b/benchmarks/smhasher/files/patch-smhasher-Platform.cpp @@ -0,0 +1,41 @@ +--- Platform.cpp 2015-03-30 17:26:46.000000000 -0400 ++++ Platform.cpp.new 2015-03-30 17:26:56.000000000 -0400 +@@ -19,6 +19,38 @@ + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_HIGHEST); + } + ++#elif __FreeBSD__ ++ ++#include <string.h> ++#include <errno.h> ++#include <sys/types.h> ++#include <sys/param.h> ++#include <sys/cpuset.h> ++ ++void ++SetAffinity(int cpu) ++{ ++ cpuset_t mask; ++ unsigned int i; ++ ++ fprintf(stdout, "SetAffinity called with arg %d\n", cpu); ++ ++ CPU_ZERO(&mask); ++ i = 0; ++ do { ++ if (cpu & 1) { ++ CPU_SET(i, &mask); ++ } ++ i++; ++ cpu >>= 1; ++ } while (cpu); ++ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, sizeof(cpuset_t), &mask) == -1) ++ { ++ fprintf(stderr, "SetAffinity() failed. %s", strerror(errno)); ++ } ++} ++ + #else + + #include <sched.h> diff --git a/benchmarks/smhasher/files/patch-smhasher-Platform.h b/benchmarks/smhasher/files/patch-smhasher-Platform.h new file mode 100644 index 000000000000..c2df8b7c99fa --- /dev/null +++ b/benchmarks/smhasher/files/patch-smhasher-Platform.h @@ -0,0 +1,12 @@ +--- Platform.h 2015-03-30 17:28:57.000000000 -0400 ++++ Platform.h.new 2015-03-30 17:28:51.000000000 -0400 +@@ -39,6 +39,9 @@ + #else // defined(_MSC_VER) + + #include <stdint.h> ++#if defined(__FreeBSD__) ++#include <stdlib.h> ++#endif + + #define FORCE_INLINE inline __attribute__((always_inline)) + #define NEVER_INLINE __attribute__((noinline)) diff --git a/benchmarks/smhasher/pkg-descr b/benchmarks/smhasher/pkg-descr new file mode 100644 index 000000000000..f85e47398c1a --- /dev/null +++ b/benchmarks/smhasher/pkg-descr @@ -0,0 +1,4 @@ +SMHasher is a test suite designed to test the distribution, collision, +and performance properties of non-cryptographic hash functions - it +aims to be the "DieHarder" of hash testing, and does a pretty good job +of finding flaws with a number of popular hashes. |