Skip to content

Commit

Permalink
Fix docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
sisshiki1969 committed Jan 20, 2025
1 parent 50d3dfd commit 9a92ac6
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
50 changes: 23 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,24 @@ Presentation movie and slides for [RubyKaigi2024](https://rubykaigi.org/2024/pre

Currently, only x86-64/linux is supported.

### Build
## Build and run

To build monoruby, You'll need installation of Rust.
Please be aware that **only nightly Rust works** for monoruby.
(1) Install nightly Rust.

[Check here to install Rust](https://www.rust-lang.org/ja/tools/install),
and [see here to work with nightly Rust](https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust).
First of all, install Rust nightly.
[Check here to install Rust](https://www.rust-lang.org/ja/tools/install)

## How to run
_Caution!!_ **only nightly Rust works** for monoruby.
[See here to work with nightly Rust](https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust).

To run ruby program file on monoruby,
(2) Clone this repository.

```sh
> git clone https://github.com/sisshiki1969/monoruby.git
> cd monoruby
```

(3) Build and run monoruby with Ruby script file.

```sh
> cargo run test.rb
Expand All @@ -46,13 +53,15 @@ or
> cargo run --release -- test.rb
```

for release build.

one liner.

```sh
> cargo run -- -e "puts 100"
```

And also, you can launch REPL.
(4) Launch REPL.

```sh
> cargo run --bin irm
Expand All @@ -64,7 +73,7 @@ or
> bin/irm
```

## How to install
## Install

To install monoruby,

Expand All @@ -86,20 +95,9 @@ and its REPL.

## Benchmark

### machine spec

- Architecture: x86_64
- CPU(s): 32
- Model name: 13th Gen Intel(R) Core(TM) i9-13900HX
- Thread(s) per core: 2
- Core(s) per socket: 16
- Caches (sum of all):
- L1d: 768 KiB (16 instances)
- L1i: 512 KiB (16 instances)
- L2: 32 MiB (16 instances)
- L3: 36 MiB (1 instance)
### 1. optcarrot banechmark

### optcarrot
Please see wiki for details. (https://github.com/sisshiki1969/monoruby/wiki/optcarrot_benchmark)

Several Ruby implementations described below were measured by [optcarrot](https://github.com/mame/optcarrot) benchmark.

Expand All @@ -116,16 +114,14 @@ Several Ruby implementations described below were measured by [optcarrot](https:

![optcarrot_fps_history](./doc/optcarrot_fps_history.png)

##### with --opt option (self-rewriting optimization mode)

![optcarrot_fps_history](./doc/optcarrot_fps_history_opt.png)
### 2. micro benchmark

### micro benchmark
please see wiki for details. (https://github.com/sisshiki1969/monoruby/wiki/micro_benchmark)

- measured by [yjit-bench](https://github.com/Shopify/yjit-bench) with '--harness=harness-warmup' option.
- benchmark codes are in [the official repo](https://github.com/ruby/ruby/tree/master/benchmark) and [plb2](https://github.com/attractivechaos/plb2).

#### Rubies
#### Version of used Rubies

- monoruby: monoruby 0.3.0
- yjit: ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +YJIT +PRISM [x86_64-linux]
Expand Down
4 changes: 2 additions & 2 deletions monoruby/src/globals/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,11 +507,11 @@ impl Store {
for i in 0..func.bytecode().len() {
let bc_pos = BcIndex::from(i);
if let Some(bbid) = func.bb_info.is_bb_head(bc_pos) {
eprintln!("{:?}", bbid);
eprintln!(" {:?}", bbid);
};
let trace_ir = func.trace_ir(self, bc_pos);
if let Some(fmt) = trace_ir.format(self) {
eprintln!("{bc_pos} [{:02}] {fmt}", func.sp[i].0);
eprintln!(" {bc_pos} [{:02}] {fmt}", func.sp[i].0);
};
}
eprintln!("------------------------------------");
Expand Down

0 comments on commit 9a92ac6

Please sign in to comment.