Skip to content

ZJIT: ruby-bench perf burndown #1030

Description

@k0kubun

I investigated how ZJIT could beat YJIT in some of the benchmarks where it's currently losing. I use this issue as a reminder to make sure we tackle them. They have PoC patches, but it's not meant to be upstreamed as is; it's only there to clarify the problem. Feel free to pick up anything from here.

micro

  • throw
    • Inline block calls and specialize TAG_RETURN throw from a block. Return from the function, popping multiple frames as needed. (PoC)
  • setivar_object, setivar_young
    • GC fastpath for write barriers. (PoC)
  • ruby-xor
    • Inline String#setbyte fastpath. (PoC)
    • I haven't fully figured out what to do for "cached coderange" yet. Are there realistically no drawbacks? Should we profile, specialize, and recompile? Should the fastpath always have two branches? If we decide to just always clear it, it'd be also nice to lift it into HIR to deduplicate them.
  • str_concat
  • send_cfunc_block

other

The following things need more to catch up, but I haven't found enough for them yet:

  • protoboeuf-encode
    • Inline the fastpath for String#<< with a codepoint. (PoC)
    • IIRC Kevin shared his interest in porting one from YJIT this morning?
  • erubi
    • Inline String#<< fastpath & some extension to it. (PoC)
  • splay
    • Specialize Float comparison operators (PoC)
  • rubyboy
    • Compile opt_case_dispatch. (PoC)
    • Some reprofile for ivars. (PoC) I'll take a look at it as part of the function lifecycle effort.
  • rack

headline

(many of them are still under investigation)

Metadata

Metadata

Assignees

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