Project

General

Profile

Actions

Backport #8328

closed

r40457 - Hash#shift performance improvement

Added by Anonymous almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
[ruby-core:54588]

Description

r40457 contains a patch which significantly improves the performance of Hash#shift.

As it does not change behaviour, it should be backported.

Thanks.


Files

backport_fix_shift.diff (3.29 KB) backport_fix_shift.diff funny_falcon (Yura Sokolov), 06/02/2013 08:42 PM

Updated by usa (Usaku NAKAMURA) almost 11 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

Sorry for late reply.

trunk is too different from 1.9.3, so I cannot patch r40457 simply.
Please wait more.

Updated by funny_falcon (Yura Sokolov) almost 11 years ago

Backported version of "fix Hash#shift" attached.

Actions #3

Updated by usa (Usaku NAKAMURA) almost 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41652.
Charlie, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


[Backport #8328] [ruby-core:55250] Patch by funny-falcon

  • benchmark/bm_hash_shift.rb: add benchmark for Hash#shift

  • 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

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0