/mobile Handheld Friendly website
Ubuntu : Intel® Q6600® one core |
Each chart bar shows, for one unidentified benchmark, how much the fastest Lua program used compared to the fastest Python 3 program.
These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.
Each table row shows, for one named benchmark, how much the fastest Lua program used compared to the fastest Python 3 program.
| Lua used what fraction? used how many times more? | ||||
|---|---|---|---|---|
| Benchmark | Time | Memory | Code | |
| fasta | 1/5 | 1/4 | ± | |
| spectral-norm | 1/4 | 1/6 | ± | |
| mandelbrot | 1/3 | 1/6 | 1/2 | |
| n-body | 1/2 | 1/6 | ± | |
| k-nucleotide | 1/2 | 2× | ± | |
| fannkuch-redux | 1/2 | 1/6 | ± | |
| pidigits | ± | 1/4 | 2× | |
| binary-trees | ± | 2× | ± | |
| regex-dna | 2× | 3× | ± | |
| reverse-complement | 3× | ± | 2× | |
| Lua used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (Elapsed secs) | 1/5 | 1/5 | 1/3 | 1/2 | ± | 2× | 3× |
± read the measurements and then read the program source code.
These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.
For each named benchmark, measurements of the fastest Lua program are shown for comparison against measurements of the fastest Python 3 program.
| Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| fasta | |||||
| Lua | 49.71 | 49.72 | 1,112 | 1049 | 0% 1% 0% 100% |
| Python 3 | 259.48 | 262.34 | 4,672 | 788 | 0% 1% 1% 100% |
| spectral-norm | |||||
| Lua | 243.58 | 243.64 | 940 | 329 | 0% 0% 0% 100% |
| Python 3 | 1,018.20 | 1,018.44 | 5,208 | 328 | 0% 0% 0% 100% |
| mandelbrot | |||||
| Lua | 786.43 | 786.61 | 1,044 | 353 | 0% 0% 0% 100% |
| Python 3 | 1,845.31 | 1,968.40 | 6,748 | 777 | 1% 0% 0% 100% |
| n-body | |||||
| Lua | 461.37 | 461.47 | 836 | 1193 | 0% 0% 0% 100% |
| Python 3 | 1,098.65 | 1,098.89 | 4,700 | 1181 | 0% 0% 0% 100% |
| k-nucleotide | |||||
| Lua | 220.11 | 220.81 | 707,928 | 613 | 0% 0% 0% 100% |
| Python 3 | 474.71 | 474.95 | 426,212 | 647 | 1% 0% 0% 100% |
| fannkuch-redux | |||||
| Lua | 2,131.11 | 2,131.55 | 820 | 462 | 0% 0% 0% 100% |
| Python 3 | 2,903.20 | 3,204.31 | 4,564 | 385 | 0% 0% 0% 100% |
| pidigits | |||||
| Lua | 2.51 | 2.52 | 1,460 | 479 | 0% 1% 1% 100% |
| Python 3 | 3.06 | 3.06 | 5,408 | 255 | 1% 0% 1% 100% |
| binary-trees | |||||
| Lua | 449.99 | 450.48 | 1,033,624 | 446 | 0% 14% 4% 100% |
| Python 3 | 504.56 | 504.93 | 685,724 | 626 | 0% 0% 0% 100% |
| regex-dna | |||||
| Lua | 43.90 | 43.94 | 494,992 | 437 | 0% 0% 0% 100% |
| Python 3 | 21.13 | 21.14 | 194,612 | 424 | 0% 0% 0% 100% |
| reverse-complement | |||||
| Lua | 22.49 | 22.51 | 724,576 | 555 | 0% 0% 0% 100% |
| Python 3 | 6.50 | 6.51 | 616,588 | 325 | 0% 0% 0% 100% |
| fasta-redux | |||||
Remember - those are just the fastest Lua and Python 3 programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Lua.
Maybe one of those other Lua programs is fastest on a different OS/machine.
Remember - those are just the fastest Lua and Python 3 programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.
Maybe one of those other programs is fastest on a different OS/machine.
online book "Programming in Lua" by Roberto Ierusalimschy
"Game Developers Conference 2010 Lua Tutorial" (slides)
Lua 5.2.1 Copyright (C) 1994-2012 Lua.org, PUC-Rio
Home Page: http://www.lua.org/
Download: http://www.lua.org/download.html