Raylib bindings bunnymarks
2024-05-21 06:43:40 +02:00
ada jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00
beef beef release mode 2024-02-10 17:27:30 +01:00
c jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00
cobol add cobol 2023-12-21 20:40:31 +01:00
csharp fix java and c sharp 2023-12-21 06:32:41 +01:00
d add d 2023-12-16 19:26:02 +01:00
fasm add objective-c 2024-02-09 16:23:57 +01:00
fortran add fortran 2023-12-16 18:41:41 +01:00
freebasic add freebasic 2024-02-24 11:59:46 +01:00
hare add hare 2024-02-15 06:50:33 +01:00
java jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00
java-ffm jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00
js add javascript 2023-12-17 08:32:22 +01:00
jython update jython version 2024-02-24 16:06:25 +01:00
lua jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00
objc add beef 2024-02-09 22:53:20 +01:00
pascal pascal length 2023-12-16 13:58:37 +01:00
python add javascript 2023-12-17 08:32:22 +01:00
rust add hare 2024-02-15 06:50:33 +01:00
vala add vala 2024-02-15 21:10:17 +01:00
zig add zig 2023-12-17 10:22:32 +01:00
README.md jaylib ffm is slower than I expected 2024-05-21 06:43:40 +02:00

rl-bunnymarks

This repository contains so called bunnymarks in various languages, all using bindings of raylib.

A bunnymark is a type of benchmark, where objects called bunnies ravage through the screen in random directions with random speed.

All projects within this repository are set to run with 100,000 (one hundred thousand) bunnies.

Structure

You will find there directories with projects. Each has a 'run.sh' script that runs the project (assuming you have installed the correct tools), and a 'clean.sh' script that removes all the binaries build.

Languages

Note: all fps tests were done on my own computer, may be different on yours, but generally the ration should be similar.

  • Java in the 'java' directory, average 83fps, needs 'java' and 'javac'
  • C# in the 'csharp' directory, average 87fps, needs 'dotnet'
  • C in the 'c' directory, average 90fps, needs 'gcc'
  • Pascal in the 'pascal' directory, average 106fps, needs lazarus
  • Rust in the 'rust' directory, average 63fps, needs 'rustc' and 'cargo'
  • Fortran in the 'fortran' directory, average 80fps, needs 'gfortran'
  • D in the 'd' directory, average 90fps, needs 'dub' and 'dmd'
  • Python in the 'python' directory, average 4fps, needs 'python3'
  • Javascript in the 'js' directory, average 28fps, needs 'npm' and 'node'
  • Zig in the 'zig' directory, average 81fps, needs 'zig'
  • COBOL in the 'cobol' directory, average 12fps, needs 'cobc' (GnuCOBOL)
  • Objective-C in the 'objc' directory, average 16fps in GCC and average 40fps in CLANG, needs gnustep-base
  • FASM assembly in the 'fasm' directory. Unfinished
  • Beef in the 'beef' directory, average 98fps (in Release mode; in Debug it's 10fps less), needs beef
  • Hare in the 'hare' directory, average 102fps, needs hare, harec, qbe
  • Vala in the 'vala' directory, average 79fps, needs valac
  • Lua in the 'lua' directory, average 25fps, needs raylua_s
  • FreeBASIC in the 'freebasic' directory, average 87fps, needs 'fbc'
  • Jython in the 'jython' directory, average 8fps, needs 'java'
  • Java (Jaylib FFM) in the 'java-ffm' directory, average 79fps, needs JDK 22

Damn. I just wrote such a bunnymark in C/SDL2 and I got 540FPS. SDL2 is for raylib what a rocket is for a car.

Why

I do this, as I want to see which language has the best performance, and I learn languages by writing this code.

Coding in rust was faqing painful, and its performance is bad. Idk if it's because rust's rl binding is outdated, but still. I hate rust.

After all, after spending many hours on trying to get it working in fortran I appreciate how great rust is.

Damn, I said rust is slow, but in comparison to python it is a leopard of speed.

Actually I am pretty suprised how good the performance of JS is compared to python. Both are duck-typed interpreted languages, and yet one severely overperforms the another. Right, in clang it is 4 times faster.

Zig is terrible.

I didn't expect COBOL's performance to be so bad. It is because the GnuCOBOL compiler apparently generates trash code that terribly lags. Of course no insult to the compiler authors, thank them for the compiler as we don't have anything better.

Honestly Objective-C is better than I though, but it took me a whole day to get what and why. I think the performance is that bad, because it's transpiled to C. I'll try a different OBJC compiler, and show the results.

Beef has a really nice Java-like syntax, and a nice standard library. And the best part is that it is compiled to native executables. I don't like however, that one has to manually build it - for me it took like 3 hours to do so. Beef itself takes little time to compile, but it also compiles the whole LLVM, and this is the problem. Almost every Linux PC has LLVM installed, so they should add an option to use system LLVM, would be nice to do so.

Hare is damn fast and I like it.

Vala is bad.

Coding in lua is painful.

System compatibility

Tested on Gentoo Linux. Should work on any distro (or BSD) with the requirements installed.

I don't guarantee that windows or mac will work, probably not.

You also need to have the raylib library (raylib.so and libraylib.a) in your default libspace (/usr/lib on Linux, /usr/local/lib on FreeBSD and OpenBSD, /usr/pkg/lib on NetBSD and so on).