Better HN
topnewbestaskshowjobs
Log inSign up

niofis

8 karma · joined Mar 14, 2012 (14y ago) · 6 submissions

Submissions

comment 7y ago · link · parent

That's correct, as the nim's generated C code is not idiomatic.

comment 7y ago · link · parent

Yeah, I've meant to update it and add more language implementations, but haven't really got the time. Might as well do so soon as almost all compilers/interpreters have new versions which I suspect have many nice optimizations.

comment 7y ago · link · parent

Did some testing and found that it boils down to three things: RNG algorithm used in the standard library, forced use of double precision floating point numbers (the case for OCaml and javascript), and like you mentioned, memory management.

EDIT: forgot to mention the obvious things: compiler/interpreter maturity and inherent overhead.

comment 7y ago · link · parent

This seems like a nice improvement, could you send a PR for it?

comment 7y ago · link · parent

It got me thinking as well, so I ventured and did some experiments on this, and found that the main difference is the algorithm used for the RNG; C's std lib uses a slower one (which also is thread safe, and butchered OpenMP performance). You can take a look at a more apples to apples comparison in the latest update for crb.c which uses a xor128 rng; rust is still a little faster (especially when going multithreaded), but not quite the difference in the README file, still need to get some time to update it.

comment 9y ago · link · parent

Location: Sonora, Mexico

Remote: Yes

Willing to relocate: Yes

Technologies: node.js, angular, c/c++, apache cordova, ionic framework, javascript, linux, windows, raspberry pi, SQL Server, Azure

Résumé/CV: https://1drv.ms/b/s!AimyIhrRbuaLiZJ_y6ryrHXWQRIKaA

email: enrique at eccentricdevelopments.com