randのばらつき方が均等になる、という理由でMath::Random::MTが使われているようです。(身近で
macにXS版を入れようとすると
In file included from _mt.c:1:
mt.h:17: error: expected specifier-qualifier-list before 'uint32_t'
mt.h:21: error: expected ')' before 'seed'
mt.h:22: error: expected ')' before '*' token
_mt.c:17: error: expected declaration specifiers or '...' before 'uint32_t'
_mt.c: In function 'mt_init_seed':
_mt.c:20: error: 'uint32_t' undeclared (first use in this function)
_mt.c:20: error: (Each undeclared identifier is reported only once
_mt.c:20: error: for each function it appears in.)
_mt.c:20: error: 'mt' undeclared (first use in this function)
_mt.c:22: error: 'struct mt' has no member named 'mt'
_mt.c:23: error: 'seed' undeclared (first use in this function)
っていうようなエラーがでてmakeがこけるところは、
#if defined(_MSC_VER) && (_MSC_VER <= 1300)
typedef unsigned __int32 uint32_t;
#elif defined(__linux__) || defined(__GLIBC__) || defined(__WIN32__)
#include <stdint.h>
#elif defined(__osf__)
#include <inttypes.h>
#else
#include <sys/types.h>
#endif
このifdefがうまくいってないようだったのでとりあえず
#include <inttypes.h>
と手で書いてあげたりするとうまくmake && make testが通るようになりました この辺はどう書くのが鉄板なんでしょうね?
ということでベンチマーク
ここがボトルネックになることはあまり無いとは思いますが。