nsf / pnoise Goto Github PK
View Code? Open in Web Editor NEWPerlin noise benchmark
Perlin noise benchmark
need at least 10k iterations to let JIT kick in
I'm investigating languages in an effort to finally ditch C++, and have narrowed it down more and more to Nim, still investigating. So I was curious to the slowness in these benches since I've seen it top many. Was nim -d:release --opt:fast
used?
0.5.1 is listed, Crystal is at 0.6.1 as of now
Nim has recently been updated as well :P
Each language here uses different RNGs.
If this test is for the performance of each builtin PRNG, this is fair, otherwise a single random implementation should be used for each language.
For example Java uses a version of Linear_congruential_generator
As does C/C++ under glibc
Python uses the better "mersenne twister".
Go uses 64 bit prandom integers on the other hand rather than a 32 bit which may slow performance.
D (gdc): 0,066999680 seconds time elapsed
gcc -O3: 0,076729664 seconds time elapsed
Crystal: 0,077063864 seconds time elapsed
Nim (clang): 0,077463342 seconds time elapsed
Rust: 0,078053001 seconds time elapsed
D (ldc2): 0,096995053 seconds time elapsed
clang -O3: 0,143604111 seconds time elapsed
Nim (gcc): 0,159299532 seconds time elapsed
Go gccgo -O3: 0,309625279 seconds time elapsed
D (dmd): 0,339820165 seconds time elapsed
Go gc: 0,360201714 seconds time elapsed
Java: 0,597987438 seconds time elapsed
mono C#: 1,052041381 seconds time elapsed
Update system to use Rust 1.0.0-beta instead of 0.13 for benchmark as this is the most accurate release version up to now.
If I run compile.bash I got an error
error[E0554]: #[feature] may not be used on the stable release channel
--> test.rs:15:1
|
15 | #![feature(rand)]
| ^^^^^^^^^^^^^^^^^
error: aborting due to previous error
I use rustc 1.14.0 (e8a012324 2016-12-16)
Crystal has updated to 0.7.1 now with non-blocking IO and coroutines
Such as random()
and print()
, These calls may spent different time result the comparation no sense.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.