A simple benchmark to compare Lua and your compiler to another popular languages
- C
- Python
The script used in all of the languages is a simple loop that create a array and with that array we check if the item in the array is a prime number, if yes then append in another array
| Languages | Time in secs. |
|---|---|
| Python | ~27.1 |
| C | ~1.0 |
| Lua | ~3.8 |
| Luajit | ~1.9 |
gcc test.c -o test.shThen
./test.sh python test.pyOr
python3 test.py lua test.luaOr if you want run compiled
luajit test.lua