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

optimize performance of rb_str_resurrect #1050

Closed
wants to merge 3 commits into from

Conversation

kazuho
Copy link

@kazuho kazuho commented Oct 8, 2015

Thank you for applying the proposed approach in e2cabc2.

Unfortunately, there were issues in the commit (and other related commits) that failed to gain the maximum from the division of fast and slow passes. This PR addresses the issue.

The numbers I see when running the code below is as follows:

compiler trunk this PR
gcc 4.8.2 (linux) 1.31 1.27
gcc 5.1.0 (OS X) 1.49 1.42
clang-600.0.56 (OS X) 1.58 1.51

benchmark code:

require "benchmark"
N = 20_000_000
GC.start; GC.start # magic
Benchmark.bm{|bm|
  bm.report{N.times{str = "a"}}
}

@hsbt hsbt assigned ko1 Oct 8, 2015
ko1 added a commit that referenced this pull request Oct 10, 2015
  #1050
  by Kazuho Oku <[email protected]>.
  This pull request has the following commits.
* gc.c: reduce # of args to 6 (max. of register args on x86-64) so
  that the `newobj_of_slowpass` can be called via TCO.
* gc.c (newobj_of), string.c (str_duplicate): for performance,
  the hot functions must be inlined.
* gc.c: for performance, preceding arguments of `.*newobj_of.*`
  must be same, so that the arg registers can be reused in case of
  TCO.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
@ko1
Copy link
Contributor

ko1 commented Oct 10, 2015

merged.

@ko1 ko1 closed this Oct 10, 2015
sonots pushed a commit to sonots/ruby that referenced this pull request Nov 17, 2015
  ruby#1050
  by Kazuho Oku <[email protected]>.
  This pull request has the following commits.
* gc.c: reduce # of args to 6 (max. of register args on x86-64) so
  that the `newobj_of_slowpass` can be called via TCO.
* gc.c (newobj_of), string.c (str_duplicate): for performance,
  the hot functions must be inlined.
* gc.c: for performance, preceding arguments of `.*newobj_of.*`
  must be same, so that the arg registers can be reused in case of
  TCO.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants