forked from MacRuby/MacRuby
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
should not raise an exception, so implement vm_fast_mod(). fix #1471
The modulo between the Fixnum/Float is improved the performance by this patch. * before user system total real 1.000000 0.000000 1.000000 ( 1.000743) 1.030000 0.000000 1.030000 ( 1.030479) 1.090000 0.000000 1.090000 ( 1.097021) * after user system total real 0.570000 0.000000 0.570000 ( 0.577238) 1.040000 0.000000 1.040000 ( 1.031634) 0.540000 0.000000 0.540000 ( 0.539968) Test Script: ---- require 'benchmark' Benchmark.bm do |x| x.report do 10_000_000.times do 42 % 1 end end x.report do 10_000_000.times do 42 % 1.0 end end x.report do 10_000_000.times do 42.0 % 1.0 end end end
- Loading branch information
1 parent
9dec8ce
commit a3b91c6
Showing
4 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ _rstr_concat | |
_selPLUS | ||
_selMINUS | ||
_selDIV | ||
_selMOD | ||
_selMULT | ||
_selLT | ||
_selLE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters