Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 1.02 KB

README.md

File metadata and controls

64 lines (47 loc) · 1.02 KB

lua-benchmark

A simple benchmark to compare Lua and your compiler to another popular languages

Current compared Languages

  • C
  • Python

The Script

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

Benchmark

Languages Time in secs.
Python ~27.1
C ~1.0
Lua ~3.8
Luajit ~1.9

Run Scripts

To run the scripts type:

C

  gcc test.c -o test.sh

Then

  ./test.sh

Python

    python test.py

Or

    python3 test.py

Lua

    lua test.lua

Or if you want run compiled

    luajit test.lua

Links to languages websites