diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-29 07:04:50 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-29 07:04:50 +0000 |
commit | 31ecd18f1aa0589571c2a1264d9e45d7b228d644 (patch) | |
tree | 50a4592488c37e50dd8fb7783033948110aece0a /tool/ruby_vm | |
parent | 7d4ad74f22fa259ee81064970fa12d9942472c13 (diff) | |
download | ruby-31ecd18f1aa0589571c2a1264d9e45d7b228d644.tar.gz |
s/CALL_SIMPLE_METHOD/DISPATCH_ORIGINAL_INSN/
Now that DISPATCH_ORIGINAL_INSN is introduced, we can replace
CALL_SIMPLE_METHOD with DISPATCH_ORIGINAL_INSN. These two macros
differ in size very much and results in this big difference in
compiled binary size. This changeset reduces the size of
vm_exec_core from 32,352 bytes to 27,008 bytes on my machine. As
a result it yields slightly better performance.
Closes [GH-1779].
-----------------------------------------------------------
benchmark results:
minimum results in each 3 measurements.
Execution time (sec)
name before after
so_ackermann 0.484 0.454
so_array 0.837 0.779
so_binary_trees 5.928 5.801
so_concatenate 3.473 3.543
so_count_words 0.201 0.222
so_exception 0.255 0.252
so_fannkuch 1.080 1.019
so_fasta 1.459 1.463
so_k_nucleotide 1.218 1.180
so_lists 0.499 0.484
so_mandelbrot 2.189 2.324
so_matrix 0.510 0.496
so_meteor_contest 3.025 2.925
so_nbody 1.319 1.273
so_nested_loop 0.941 0.932
so_nsieve 1.806 1.647
so_nsieve_bits 2.151 2.078
so_object 0.632 0.621
so_partial_sums 1.560 1.632
so_pidigits 1.190 1.183
so_random 0.333 0.353
so_reverse_complement 0.604 0.586
so_sieve 0.521 0.481
so_spectralnorm 1.774 1.722
Speedup ratio: compare with the result of `before' (greater is better)
name after
so_ackermann 1.065
so_array 1.075
so_binary_trees 1.022
so_concatenate 0.980
so_count_words 0.903
so_exception 1.009
so_fannkuch 1.059
so_fasta 0.997
so_k_nucleotide 1.032
so_lists 1.032
so_mandelbrot 0.942
so_matrix 1.028
so_meteor_contest 1.034
so_nbody 1.036
so_nested_loop 1.009
so_nsieve 1.097
so_nsieve_bits 1.035
so_object 1.018
so_partial_sums 0.956
so_pidigits 1.006
so_random 0.943
so_reverse_complement 1.032
so_sieve 1.083
so_spectralnorm 1.030
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/ruby_vm')
-rw-r--r-- | tool/ruby_vm/models/bare_instructions.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tool/ruby_vm/models/bare_instructions.rb b/tool/ruby_vm/models/bare_instructions.rb index f2690501fc..2d6db2849e 100644 --- a/tool/ruby_vm/models/bare_instructions.rb +++ b/tool/ruby_vm/models/bare_instructions.rb @@ -69,9 +69,11 @@ class RubyVM::BareInstructions return @variables \ . values \ . group_by {|h| h[:type] } \ + . sort_by {|t, v| t } \ . map {|t, v| [t, v.map {|i| i[:name] }.sort ] } \ - . map {|t, v| sprintf("%s %s", t, v.join(', ')) } \ - . sort + . map {|t, v| + sprintf("MAYBE_UNUSED(%s) %s", t, v.join(', ')) + } end def preamble @@ -127,8 +129,7 @@ class RubyVM::BareInstructions generate_attribute 'rb_num_t', 'retn', rets.size generate_attribute 'rb_num_t', 'width', width generate_attribute 'rb_num_t', 'sp_inc', rets.size - pops.size - generate_attribute 'bool', 'handles_frame', \ - opes.any? {|o| /CALL_INFO/ =~ o[:type] } + generate_attribute 'bool', 'handles_frame', false end def typesplit a |