Skip to content

List of YJIT experiments and takeaways #497

@maximecb

Description

@maximecb

In order to guide the development of YJIT, we perform a fair number of small experiments. However, we do so many of these, that it becomes hard to remember them all and keep track of all the documents, issues, etc. I'm opening this issue so we can gather keep track of the experiments we perform, the data we gather, and the takeaways we come to.

I'm going to pin this issue. You should be able to edit this comment to add to the list, or comment on the issue. Please include links to relevant documents, issues or PRs, and try to summarize takeaways in one or two sentences :)

Method calls

Call frequency and call types in yjit-bench

ruby/ruby-bench#168

Takeaway: C method calls are the most popular. Block calls don't happen that often compared to them.

Reducing interp_return by rewriting Array#each in Ruby

#493 (comment)

Takeaway: It reduces interp_return by 3%. But it doesn't give a speedup overall.

JIT ABI to return multiple values

ruby#7543

Takeaway: No impact on railsbench, liquid-render speeds up by 1~2%. Not worth the complexity.

Memory usage

Memory used by YJIT Rust

#484

Takeaway: Reducing the number of Blocks and Branches is the key. Context uses only 10~15% of all memory usage.

Distribution of Context objects on railsbench

https://gist.github.com/k0kubun/c1a5854e011db90d7e6efd73a6eda3b3

Takeaway: Contexts are currently very sparse, most types are unknown. There's definitely room for memory savings.

Context memory saving experiments

Takeaway: Deduplicating Context with HashSet<Rc<Context>> works the best. But it might change as Context changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions