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

Let rb_mod_const_at and rb_const_list use an ID table instead for inherited VS private constant segregation #2840

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

methodmissing
Copy link
Contributor

lourens@CarbonX1:~/src/ruby/ruby$ make benchmark ITEM=constants COMPARE_RUBY=~/src/ruby/trunk/ruby OPTS="-v --repeat-count 12 --repeat-result median"
/usr/local/bin/ruby --disable=gems -rrubygems -I./benchmark/lib ./benchmark/benchmark-driver/exe/benchmark-driver \
            --executables="compare-ruby::/home/lourens/src/ruby/trunk/ruby -I.ext/common --disable-gem" \
            --executables="built-ruby::./miniruby -I./lib -I. -I.ext/common  ./tool/runruby.rb --extout=.ext  -- --disable-gems --disable-gem" \
            $(find ./benchmark -maxdepth 1 -name 'constants' -o -name '*constants*.yml' -o -name '*constants*.rb' | sort) -v --repeat-count 12 --repeat-result median
compare-ruby: ruby 2.8.0dev (2020-01-15T01:50:53Z master ac93cf4ff8) [x86_64-linux]
built-ruby: ruby 2.8.0dev (2020-01-15T02:06:58Z opt-const-at 3d5e2d4f68) [x86_64-linux]
Calculating -------------------------------------
                     compare-ruby  built-ruby 
                 all     412.156k    519.808k i/s -      1.000M times in 2.443206s 1.932313s
           inherited     431.349k    522.407k i/s -      1.000M times in 2.338914s 1.930936s

Comparison:
                              all
          built-ruby:    519808.1 i/s 
        compare-ruby:    412156.0 i/s - 1.26x  slower

                        inherited
          built-ruby:    522406.7 i/s 
        compare-ruby:    431348.9 i/s - 1.21x  slower

@methodmissing
Copy link
Contributor Author

Despite these declarations in ruby/intern.h returning void pointers, which were in fact pointers to ST tables, I don't think this change would / should break any extensions:

void *rb_mod_const_at(VALUE, void*);
void *rb_mod_const_of(VALUE, void*);

@methodmissing
Copy link
Contributor Author

Fails CI on a macOS timeout, as is the case with other open PRs

@methodmissing methodmissing changed the title Let rb_mod_const_at and rb_const_list use ID tables instead for inherited VS private constant segregation Let rb_mod_const_at and rb_const_list use an ID table instead for inherited VS private constant segregation Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant