Thanks for your efforts @mora. The output looks like it could be very useful.
Learning, debugging? Haven't quite decided. Something, I'm sure. Hope to have a
play with it soon. Cheers.
test.nim fails for me with GCC ('could not load: libRmath-nim.so') but not with
Clang. Rarely does failure make me so happy! Thanks.
Originally compiled my own libRmath-nim.so but tried using the nimble-pkg
provided copy instead (via LD_LIBRARY_PATH). Still same result. My C compilers
are slightly older. Clang 3.6, GCC 4.8.4. I'd be surprised if that made a
difference. I'm assuming, @andrea, that gibbs succeeds for you with -
Have just built _distributions_ and libRmath-nim. sir.nim and gibbs.nim both
compile (and run) successfully for me in both release and debug modes, for Nim
0.14.2 and Nim devel. I'm on Linux x86_64. Have tried both GCC and Clang. What
configuration is causing the issue?
This is only a guess, but I wonder if _dead code elimination_ is (for some
reason) removing the hooks to your library. Try compiling with
nim c -d:release --deadCodeElim:off sir
instead. Does that help?
My apologies. I only looked at seq and (mistakenly) assumed all were faster. On
my (rather slow) laptop, the results of the ptr benchmark are
refc:
Sequence 2.70ms/iter
List 2.99ms/iter
FastStack 2.23ms/iter
Boehm:
Sequence 2.43ms/iter
List 3
With the Boehm GC, seq is faster in both of your benchmarks. The default
ref-counting GC definitely has limitations. Also, it's probably better to
initialise FastStack to the same capacity as the seq. 1000 vs 0 isn't really
fair.
Hopefully, expr and stmt will be deprecated soon. The manual [seems
to](http://forum.nim-lang.org///nim-lang.org/docs/manual.html#templates-typed-vs-untyped-parameters)
imply this will happen.