|
1 | 1 | # rvm |
2 | 2 |
|
3 | | -A virtual machine. |
| 3 | +A tiny, fast, portable, and embeddable low-level virtual machine. |
| 4 | + |
| 5 | +*`rvm` is now complete!* |
| 6 | + |
| 7 | +## Usage |
| 8 | + |
| 9 | +1. Make sure you have `make` and `gcc`/`clang` installed. |
| 10 | +2. Clone the repo. |
| 11 | +3. Run `make -C'path/to/repo'` |
| 12 | + |
| 13 | +**For the APIs**: Please read the source code. Check out `test/test.c` to see |
| 14 | +how to set it up. I don't plan to write a full documentation, yet. Thanks for |
| 15 | +understanding. |
| 16 | + |
| 17 | +## Benchmarks |
| 18 | + |
| 19 | +I've got no access to a PC. RVM was entirely built on my phone, which has |
| 20 | +these decent specs: |
| 21 | + |
| 22 | +- processor: Unisoc T603 |
| 23 | +- cpu: 8 cores (4x 1.2GHz + 4x 1.8GHz) |
| 24 | +- arch: armv8 (aarch64), little-endian |
| 25 | +- ram: 4GB (+4GB swap) |
| 26 | + |
| 27 | +| Test | Elapsed time | Inst Count | Avg TPI | Inst Rate | |
| 28 | +| :------------: | :----------: | :-----------------: | :-----: | :--------: | |
| 29 | +| `nops` | 3.651 ms | 1048576 (1.05 M) | 3.482ns | 287.2M IPS | |
| 30 | +| `cnt_1bill` | 9.509 secs | 1000000006 (1.01 B) | 8.317ns | 105.2M IPS | |
| 31 | +| `naive_fib_40` | 18.662 secs | 2980442527 (2.98 B) | 6.262ns | 159.7M IPS | |
| 32 | + |
| 33 | +CI benchmarks (GitHub-hosted runner): |
| 34 | + |
| 35 | +| Test | Elapsed time | Inst Count | Avg TPI | Inst Rate | |
| 36 | +| :------------: | :----------: | :-----------------: | :-----: | :--------: | |
| 37 | +| `nops` | 456.413 μs | 1048576 (1.05 M) | 0.435ns | 2.297G IPS | |
| 38 | +| `cnt_1bill` | 2.904 secs | 1000000006 (1 B) | 2.904ns | 344.4M IPS | |
| 39 | +| `naive_fib_40` | 4.459 secs | 2980442527 (2.98 B) | 1.496ns | 668.4M IPS | |
| 40 | + |
| 41 | +In the naive `fib(40)` test, RVM is ~2.5× slower than LuaJIT — but |
| 42 | +**orders of magnitude faster** than Python! |
| 43 | + |
| 44 | +## Contributing |
| 45 | + |
| 46 | +I'd appreciate any contributions! To contribute: |
| 47 | + |
| 48 | +1. Fork the repo |
| 49 | +2. Clone your fork |
| 50 | +3. Make a new branch: |
| 51 | + |
| 52 | + ```sh |
| 53 | + git checkout -b fix/somebug |
| 54 | + ``` |
| 55 | + |
| 56 | +4. Make your changes. |
| 57 | +5. Commit and push. |
| 58 | + |
| 59 | + ```sh |
| 60 | + git commit -m "fix bug #123" |
| 61 | + git push |
| 62 | + ``` |
| 63 | + |
| 64 | +6. Open a pull request. |
| 65 | + |
| 66 | +Then just sit back! I may not respond instantly, but I’m always open to |
| 67 | +contributions. Thanks! |
4 | 68 |
|
5 | 69 | ## License |
6 | 70 |
|
|
0 commit comments