Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIT not tracing through Timsort and not virtualizing through ordereddict #833

Open
timfel opened this issue Aug 1, 2014 · 6 comments
Open

Comments

@timfel
Copy link
Member

timfel commented Aug 1, 2014

This is the reason we are so slow on the "Acid" benchmark presented here: http://www.chrisseaton.com/rubytruffle/pushing-pixels/

@alex
Copy link
Member

alex commented Aug 1, 2014

Where would you expect it to trace in Timsort? Is the problem that the comparator isn't inlined?

Can you show a small trace with an example of the orderreddict?

@alex
Copy link
Member

alex commented Aug 2, 2014

Can you let me know if #834 helped?

Is:

module Foo
  extend self

  def foo(a, b, c)
    hash = {a: a, b: b, c: c}
    array = hash.map { |k, v| v }
    x = array[0]
    y = [a, b, c].sort[1]
    x + y
  end

end

class Bar

  def method_missing(method, *args)
    if Foo.respond_to?(method)
      Foo.send(method, *args)
    else
      0
    end
  end

end

bar = Bar.new

loop do
  start = Time.now

  1_000_000.times do
    # This block should be compiled to the constant Fixnum value 22
    bar.foo(14, 8, 6)
  end

  puts Time.now - start
end

the snippet to benchmark? If yes, I can probably run it myself.

@alex
Copy link
Member

alex commented Aug 2, 2014

It looks like the next issue is the Hash#map, we need to unroll stuff in Ruby, and I'm not sure how that would look.

@alex
Copy link
Member

alex commented Aug 2, 2014

I guess, Interpreter.jump should just not call can_enter_jit... if something.

@timfel
Copy link
Member Author

timfel commented Oct 16, 2014

I'm guessing one thing that would help on this benchmark are storage strategies. A student at HPI has been extracting the commonolaties into an rlib library that he demonstrated to work in lang-smalltalk, pycket, and topaz. I've asked him to coordinate with cfbolz to get the library into shape and I'll get him to run this with strategies.

@alex
Copy link
Member

alex commented Oct 16, 2014

Oooh, that's awesome.

On Thu, Oct 16, 2014 at 9:30 AM, Tim Felgentreff notifications@github.com
wrote:

I'm guessing one thing that would help on this benchmark are storage
strategies. A student at HPI has been extracting the commonolaties into an
rlib library that he demonstrated to work in lang-smalltalk, pycket, and
topaz. I've asked him to coordinate with cfbolz to get the library into
shape and I'll get him to run this with strategies.


Reply to this email directly or view it on GitHub
#833 (comment).

"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084

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

No branches or pull requests

2 participants