1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/test
Yusuke Endoh f71bd7477e RDoc::Parser::C: Integrate do_classes and do_modules by one regexp match
The full scan of the C source code (`@content.scan`) is very slow.
The old code invokes the scan six times in `do_classes` and
`do_modules`.

This change integrates the six scans into one by merging the regexps.
The integrated regexp is a bit hard to maintain, but the speed up is
significant: approx. 30 sec -> 20 sec in Ruby's `make rdoc`.

In addition, this change omits `do_boot_defclass` unless the file name
is `class.c`.  `boot_defclass` is too specific to Ruby's source code, so
RDoc should handle it as a special case.

Before this change:

     TOTAL    (pct)     SAMPLES    (pct)     FRAME
       858  (13.6%)         858  (13.6%)     (garbage collection)
       292   (4.6%)         264   (4.2%)     RDoc::Parser::C#do_define_class
       263   (4.2%)         250   (3.9%)     RDoc::Parser::C#do_define_module
       275   (4.3%)         241   (3.8%)     RDoc::Parser::C#do_define_class_under
       248   (3.9%)         237   (3.7%)     RDoc::Parser::C#do_define_module_under
       234   (3.7%)         234   (3.7%)     RDoc::Parser::C#gen_body_table
       219   (3.5%)         219   (3.5%)     Ripper::Lexer#state_obj
       217   (3.4%)         216   (3.4%)     RDoc::Parser::C#do_struct_define_without_accessor
       205   (3.2%)         205   (3.2%)     RDoc::Parser::C#do_boot_defclass
       205   (3.2%)         205   (3.2%)     RDoc::Parser::C#do_singleton_class

The six methods take approx. 22.2%.
`do_define_class` (4.2%) + `do_define_class_under` (3.8%) +
`do_define_module` (3,9$) + `do_define_module_under` (3.7%) +
`do_struct_define_without_accessor` (3.4%) + `do_singleton_class` (3.2%)

After this change, the methods are integrated to `do_classes_and_modules`
which takes only 5.8%.

     TOTAL    (pct)     SAMPLES    (pct)     FRAME
       812  (16.7%)         812  (16.7%)     (garbage collection)
       355   (7.3%)         284   (5.8%)     RDoc::Parser::C#do_classes_and_modules
       225   (4.6%)         225   (4.6%)     RDoc::Parser::C#gen_body_table
       429   (8.8%)         210   (4.3%)     RDoc::Parser::RubyTools#get_tk
       208   (4.3%)         208   (4.3%)     RDoc::TokenStream#add_tokens
2019-08-16 06:07:11 +09:00
..
-ext- Warn instance variable E 2019-08-10 13:18:41 +09:00
base64
benchmark Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
bigdecimal
cgi change call CGI methods from :: to . 2019-08-04 09:19:30 +09:00
coverage
csv Aliases capture_output to capture_io for test-unit compatiblity. 2019-08-08 17:19:23 +09:00
date date_parse.c: avoid copying 2019-08-12 20:41:11 +09:00
dbm
digest Restore support library for only test files that are digest and csv. 2019-07-09 21:16:49 +09:00
drb
dtrace Added test for require-return hook 2019-06-30 21:21:06 +09:00
erb Suppress uninitialized instance variable warnings 2019-07-04 18:12:08 +09:00
etc
excludes Give up stabilizing TestProcess on Travis osx 2019-08-06 00:48:00 +09:00
fiddle
fileutils Improve same directory detection in FileUtils 2019-08-06 09:01:04 +09:00
gdbm
io
irb Don't echo results of assignment expressions 2019-08-16 06:02:45 +09:00
json Ignore warnings about ambiguous first argument with the negative integer. 2019-06-01 15:07:35 +03:00
lib Restore support library for only test files that are digest and csv. 2019-07-09 21:16:49 +09:00
logger Move helper file of logger to under the test/logger. 2019-07-15 14:43:08 +09:00
matrix
misc
mkmf Suppress messages from mkmf 2019-06-20 20:51:33 +09:00
monitor Wait for the helper thread to terminate 2019-06-28 14:54:00 +09:00
net Adding missing test for Net::HTTPGenericRequest initializer (#1835) 2019-08-16 01:38:46 +09:00
nkf
objspace Suppress unused variable warnings 2019-06-30 11:45:37 +09:00
open-uri The default charset of text/* media type is UTF-8. 2019-07-15 09:36:52 +09:00
openssl test/openssl/utils.rb: Extend the timeout for armv7l 2019-06-07 23:37:55 +09:00
optparse Fixed the test-case class name for zsh 2019-06-28 14:09:17 +09:00
ostruct
pathname Delegates 3 arguments for Pathname.glob. 2019-07-14 17:42:58 +09:00
psych [ruby/psych] Suppress uninitialized instance variable warnings 2019-07-25 07:52:17 +09:00
racc Clean up temporary directory for racc 2019-07-02 15:02:16 +09:00
rdoc RDoc::Parser::C: Integrate do_classes and do_modules by one regexp match 2019-08-16 06:07:11 +09:00
readline Do not always taint the result of File#path 2019-07-30 11:55:59 -07:00
reline Move a test file of Reline to test/reline/ 2019-07-15 10:40:06 +09:00
resolv Use lowercase letters for IPv6 addresses. 2019-07-30 11:59:54 +09:00
rexml [ruby/rexml] xpath: add missing value conversions for equality and relational expressions 2019-08-04 11:55:55 +09:00
rinda Fix Leaked thread 2019-07-31 17:45:43 +09:00
ripper double memory limit on MJIT. 2019-08-09 13:04:56 +09:00
rss
ruby Fixed heap-use-after-free 2019-08-15 23:39:14 +09:00
rubygems [rubygems/rubygems] Use the standard RUBY_ENGINE_VERSION instead of JRUBY_VERSION 2019-08-05 18:45:24 +09:00
scanf Use block instead of explicit close 2019-06-28 12:37:36 +09:00
sdbm
shell
socket Suppress unused variable warnings 2019-06-30 11:45:37 +09:00
stringio [ruby/stringio] Supported BOM 2019-08-14 11:20:58 +09:00
strscan
syslog
uri
webrick Adjust indent [ci skip] 2019-08-11 00:44:13 +09:00
win32ole Get rid of toplevel methods 2019-07-08 16:05:04 +09:00
yaml
zlib Suppress deflateParams() warnings 2019-07-24 22:07:10 +09:00
runner.rb Separated tool/test/runner.rb and test/runner.rb 2019-07-25 16:57:38 +09:00
test_abbrev.rb
test_cmath.rb Call deprecated method only inside assert_warning block 2019-07-01 00:22:39 +09:00
test_delegate.rb Fix visibility of some methods when using DelegateClass 2019-05-30 18:34:45 -07:00
test_extlibs.rb
test_find.rb
test_forwardable.rb Document and add spec for delegating to constants in Forwardable 2019-07-26 07:35:58 -07:00
test_ipaddr.rb Assert obsolete method warnings in IPAddr 2019-07-01 13:02:23 +09:00
test_mutex_m.rb
test_observer.rb
test_open3.rb Restore support library for only test files. 2019-07-09 21:04:07 +09:00
test_pp.rb Suppress void context warnings in verbose mode 2019-06-30 11:49:40 +09:00
test_prettyprint.rb
test_prime.rb Suppress method redefinition warnings 2019-06-30 11:49:41 +09:00
test_pstore.rb Expand the timeout of test_pstore_files_are_accessed_as_binary_files 2019-08-05 12:52:14 +09:00
test_pty.rb
test_rbconfig.rb
test_securerandom.rb Test SecureRandom.uuid format 2019-07-26 09:56:53 -07:00
test_set.rb
test_shellwords.rb
test_singleton.rb
test_sync.rb
test_syslog.rb
test_tempfile.rb
test_time.rb
test_timeout.rb
test_tmpdir.rb
test_tracer.rb
test_tsort.rb
test_unicode_normalize.rb Removed unused variables 2019-06-28 23:21:37 +09:00
test_weakref.rb
test_win32api.rb