add workload-specific GC tuning advice based on benchmark data:
- allocation-heavy: interval_ratio 400 for ~12% improvement
- real-time: step_limit for bounded pause times
- large buffers: malloc_threshold
- diagnosing GC overhead with GC.stat
Co-authored-by: Claude <noreply@anthropic.com>
Decrement gc_debt by the actual number of objects processed
instead of the fixed GC_STEP_SIZE. This makes step_ratio
directly affect debt repayment: larger steps repay more debt,
naturally reducing GC invocation frequency.
Co-authored-by: Claude <noreply@anthropic.com>
Expose gc_debt directly as :debt in GC.stat without sign negation.
The debt model has no threshold ceiling, so :threshold was a
misleading name. Negative debt means credit, positive means GC
is behind on collection work.
Co-authored-by: Claude <noreply@anthropic.com>
language.md: reorganize stdlib tables by class name instead of gem
name so users can quickly find "does mruby have Time/File/Set?"
capi.md: fix mrb_protect example (mrb->exc is cleared after protect,
so mrb_print_error does not work; show mrb_inspect instead); fix
fiber yield example to show correct usage as return value.
gc.md, compiler.md, vm.md: add "read this if" guidance paragraphs
to help developers decide whether they need each document.
Co-authored-by: Claude <noreply@anthropic.com>
Replace duplicated GC, compiler, and VM details with concise
summaries linking to gc.md, compiler.md, and vm.md.
Co-authored-by: Claude <noreply@anthropic.com>
Add sections on 64-bit inline float rotation encoding and 32-bit
RFloat heap allocation with char[] buffer for alignment safety.
Add comparison table of all three boxing modes and ABI note.
Co-authored-by: Claude <noreply@anthropic.com>
The old name referred to "truncation" of float precision, which no
longer happens with rotation encoding. The new name describes the
actual behavior: disabling inline float encoding in word boxing.
The old name is kept as an obsolete alias for backward compatibility.
Co-authored-by: Claude <noreply@anthropic.com>
Three new documents:
- doc/guides/getting-started.md: building, running, and embedding mruby
- doc/guides/capi.md: C API reference for values, classes, methods, etc.
- doc/internal/architecture.md: internal architecture for developers
Co-authored-by: Claude <noreply@anthropic.com>
Add notes section explaining the optimization behavior:
- Which functions are used for direct access
- When fallback to method dispatch occurs
- Why subclasses can override []/[]=
Co-authored-by: Claude <noreply@anthropic.com>
OP_LOADI stores an 8 bit integer to a register, so we renamed the
instruction name to describe the behavior more precisely, like
OP_LOADI16 and OP_LOADI32.
The documentation table is generated by the `rake doc:update-index` command.
The following conditions must be met for links to be added to the documentation table.
- The file must be placed under the `doc/` directory
- The file must have the extension `.md`
- The file must be written at the top of the file with `<! -- summary: ANY-TEXT -->`
- Added the index number corresponding to the instruction code.
- Omitted trailing `|` from table elements.
The table elements in GitHub Flavored Markdown can't wrap wherever wanted.
And trying to align the end of it tends to make the whole thing longer.
Allow to update `doc/internal/opcode.md` file mechanically from `include/mruby/ops.h` file.
At the same time, the `doc/internal/opcode.md` file has been updated.
Consecutive hyphens at the end of the table were removed as they would have created noise as markdown flavours.
Transforms the value of a splat inside a return statement (similar
to an array). For example, `return *nil` should return `nil.to_a`,
while `return *1` should return `[1]`