* hash.c (rb_hash_shift): use st_shift if hash is not being iterated to
delete element without iterating the whole hash.
* hash.c (shift_i): remove function
* include/ruby/st.h (st_shift): add st_shift function
* st.c (st_shift): ditto
[Bug #8312] [ruby-core:54524] Patch by funny-falcon
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
You don't need to use `;' separation character.
[ruby-core:50139] [ruby-trunk - Bug #7380]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to specify exclude benchmark name pattern.
You can specify "-x foo" if you want to exclude the benchmarks
if the name of benchmark contains `foo'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
which is passed as a launch parameter for each ruby's execution.
($ ruby [ARG] [File])
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
with first executables score at last of results
if two or more executrables are given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(1) Remove `average differential'.
In this benchmark driver, We should not care about `average'.
We use fastest score because this score should not include
any disturbances (affections of background process, etc).
If you care about timing affect, I recommend `median'
score with more than 5 examinations rather than simple
`average' score (`average' score was affected by error scores).
(2) Show log file name.
(3) Change default directory from './' to driver's directory.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
64bit CPU environment (sizeof(double) == sizeof(VALUE)).
flonum technique enables to avoid double object creation
if the double value d is in range about between
1.72723e-77 < |d| <= 1.15792e+77 or 0.0.
flonum Float value is immediate and their lowest two bits
are b10.
If flonum is activated, then USE_FLONUM macro is 1.
I'll write detailed in this technique on
https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Flonum_tech
* benchmark/bmx_temp.rb: add an benchmark for simple
Float calculation.
* gc.c (id2ref, rb_obj_id): add flonum Float support.
* include/ruby/intern.h: move decl of rb_float_new(double)
to include/ruby/ruby.h.
* insns.def, vm.c, vm_insnhelper.c: add flonum optimization
and simplify source code.
* vm_insnhelper.h (FLONUM_2_P): added.
* marshal.c: support flonum output.
* numeric.c (rb_float_new_in_heap): added.
* parse.y: support flonum.
* random.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This benchmark measures a initialize time of non-used variable.
* benchmark/bm_vm1_lvar_set.rb: added.
This benchmark measures a local variables initialization time.
* benchmark/bm_vm2_bigarray.rb: added.
This benchmark mesures a big array literal creation time.
* benchmark/bm_vm2_bighash.rb:
This benchmark mesures a big hash literal creation time.
* benchmark/bm*: change notation "i=0" to "i = 0".
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm.c (backtrace_object): remove lev and n parameter.
backtrace_object always returns all of backtrace information.
* vm.c (rb_backtrace_to_str_ary): fix to use backtrace_object().
This change improve performance of caller(lev, n).
* benchmark/bm_vm3_backtrace.rb: added to check above improvement.
FYI: measurement on my laptop, 1.9.3p229 needs 5.125 sec,
and current trunk only needs 0.299sec.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Backtrace information contains an array consists of location
information for each frames by string.
RubyVM::Backtrace object is lightweight backtrace information,
which contains complete information to generate traditional style
backtrace (an array of strings) with faster generation.
If someone accesses to backtrace information via
Exception#backtrace, then convert a RubyVM::Backtrace object to
traditonal style backtrace.
This change causes incompatibility on marshal dumpped binary
of Exception. If you have any trouble on it, please tell us
before Ruby 2.0 release.
Note that RubyVM::Backtrace object should not expose Ruby level.
* error.c, eval.c, vm_eval.c: ditto.
* internal.h: ditto.
* eval_error.c: fix to skip "set_backtrace" method invocation in
creating an exception object if it call a normal set_backtrace
method (defined by core).
* test/ruby/test_settracefunc.rb: fix for above change.
* vm_method.c (rb_method_defined_by): added. This function
checks that the given object responds with the given method
by the given cfunc.
* benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb:
add to measure exception creation speed. raise1 create
exception objects from shallow stack frame. raise2 create
exception objects from deep stack frame.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
it is defined. if it is not defined, assume 64 as the max of fds.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
across all runs of a benchmark. [Ruby 1.9 - Feature #4982]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
benchmark/bm_vm4_thread_mutex[1-3].rb: renamed to
bm_thread_* (fix last rename).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* benchmark/bm_vm3_thread_mutex[1-3].rb: added 3 benchmarks.
1: one thread with one mutex (no contention).
2: two threads with one mutex (contention).
3: 1000 threads with one mutex (huge number of contention)
Abobe removed benchmark was type 3.
Therefore, this commit adds type 1 and 2 benchmark.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
performance. They was written by Koichi Sasada.
* benchmark/bm_vm4_thread_pass.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(Init_BareVM): per-VM object space support, which is disabled now.
* gc.c (rb_objspace_alloc), vm.c (Init_BareVM): should not use ruby
malloc here.
* gc.c (garbage_collect, etc): performance improvement by passing the
reference instead of refering the global variable in each functions.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e