Skip to content

YJIT: Add specialized codegen function for TrueClass#===#10640

Merged
maximecb merged 3 commits intoruby:masterfrom
Shopify:rwstauner/yjit-true-eqq
Apr 29, 2024
Merged

YJIT: Add specialized codegen function for TrueClass#===#10640
maximecb merged 3 commits intoruby:masterfrom
Shopify:rwstauner/yjit-true-eqq

Conversation

@rwstauner
Copy link
Contributor

TrueClass#=== is currently number 10 in the most frequent C calls list of the lobsters benchmark.

require "benchmark/ips"

def wrap
  true === true
  true === false
  true === :x
end

Benchmark.ips do |x|
  x.report(:wrap) do
    wrap
  end
end
before
Warming up --------------------------------------
                wrap     1.791M i/100ms
Calculating -------------------------------------
                wrap     17.806M (± 1.0%) i/s -     89.544M in   5.029363s

after
Warming up --------------------------------------
                wrap     4.024M i/100ms
Calculating -------------------------------------
                wrap     40.149M (± 1.1%) i/s -    201.223M in   5.012527s

@matzbot matzbot requested a review from a team April 25, 2024 23:48
TrueClass#=== is currently number 10 in the most frequent C calls list of the lobsters benchmark.

```
require "benchmark/ips"

def wrap
  true === true
  true === false
  true === :x
end

Benchmark.ips do |x|
  x.report(:wrap) do
    wrap
  end
end
```

```
before
Warming up --------------------------------------
                wrap     1.791M i/100ms
Calculating -------------------------------------
                wrap     17.806M (± 1.0%) i/s -     89.544M in   5.029363s

after
Warming up --------------------------------------
                wrap     4.024M i/100ms
Calculating -------------------------------------
                wrap     40.149M (± 1.1%) i/s -    201.223M in   5.012527s
```

Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com>
Co-authored-by: Kevin Menard <kevin.menard@shopify.com>
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
@rwstauner rwstauner force-pushed the rwstauner/yjit-true-eqq branch from bddd936 to 8fb684a Compare April 26, 2024 00:05
@maximecb maximecb merged commit 845f2db into ruby:master Apr 29, 2024
@maximecb maximecb deleted the rwstauner/yjit-true-eqq branch April 29, 2024 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants