nsf / pnoise Goto Github PK
View Code? Open in Web Editor NEWPerlin noise benchmark
Perlin noise benchmark
Perlin noise benchmark. Runs perlin noise 256x256 image generation 100 times. Currently the frontend is just a bunch of shell scripts to compile/run compiled versions of it. You'll have to run scripted versions manually with the interpreter of your choice. Example output of the run on my machine (intel i5-3470, 64 bit) and the versions I use: clang version 3.8.1 (tags/RELEASE_381/final) gcc (GCC) 6.1.1 20160802 Mono C# compiler version 4.4.1.0 Mono JIT compiler version 4.4.1 (Nightly 4.4.1.0/4747417 Thu Jul 14 18:06:32 UTC 2016) F# Compiler for F# 4.0 (Open Source Edition) DMD64 D Compiler v2.071.1 LDC - the LLVM D compiler (0.15.1): based on DMD v2.066.1 and LLVM 3.5.1 gdc (GCC) 6.1.1 20160501 go version go1.7.1 linux/amd64 gccgo (GCC) 6.1.1 20160802 rustc 1.0.0-dev (built 2015-05-17) Nim Compiler Version 0.11.2 (2015-05-05) [Linux: amd64] Crystal 0.7.1 (Пн май 11 00:47:29 UTC 2015) java version "1.8.0_66" Java(TM) SE Runtime Environment (build 1.8.0_66-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode) === clang -O3: 0,162385900 seconds time elapsed === gcc -O3: 0,089993071 seconds time elapsed === mono C#: 0,520457137 seconds time elapsed === mono F#: 0,553722808 seconds time elapsed === D (dmd): 0,314917796 seconds time elapsed === D (ldc2): 0,100076327 seconds time elapsed === D (gdc): 0,076248784 seconds time elapsed === Go gc: 0,287522697 seconds time elapsed === Go gccgo -O3: 0,259701515 seconds time elapsed === Rust: 0,074902613 seconds time elapsed === Nim (gcc): 0,160059764 seconds time elapsed === Nim (clang): 0,108235264 seconds time elapsed === Crystal: 0,071615525 seconds time elapsed === Java: 0,473815480 seconds time elapsed
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
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)
Such as random()
and print()
, These calls may spent different time result the comparation no sense.
0.5.1 is listed, Crystal is at 0.6.1 as of now
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.
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.
Nim has recently been updated as well :P
need at least 10k iterations to let JIT kick in
Crystal has updated to 0.7.1 now with non-blocking IO and coroutines
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?
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.