Project

General

Profile

Actions

Bug #9201

closed

[patch] remove GC overhead for loaded_features_index

Added by tmm1 (Aman Karmani) over 10 years ago. Updated over 10 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.1.0dev (2013-12-02 trunk 43955)
[ruby-core:58805]

Description

I was profiling minor GC in our app and noticed 15% of time spent in mark_tbl for loaded_features_index.

The following patch removes this overhead by storing feature offsets outside the ruby heap:

https://github.com/tmm1/ruby/commit/d03c5ece865422f0510957c1dee1d33a1d9eca82


Related issues 1 (0 open1 closed)

Related to Backport200 - Backport #8048: require() features_index bloats size of ruby heapClosednagachika (Tomoyuki Chikanaga)03/08/2013Actions

Updated by tmm1 (Aman Karmani) over 10 years ago

In features_index_add_single, we already Check_Type(offset, T_FIXNUM). This ensures these off-heap RArrays will only contain immediates and do not need to be marked.

Actions #2

Updated by tmm1 (Aman Karmani) over 10 years ago

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

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


  • load.c (features_index_add_single): Move loaded_features_index array values off
    the ruby heap. [Bug #9201] [ruby-core:58805]
  • load.c (loaded_features_index_clear_i): Clean up off-heap array structure.
  • vm.c (rb_vm_mark): Remove unnecessary mark_tbl for loaded_features_index.
    This improves minor GC time by 15% in a large application.

Updated by tmm1 (Aman Karmani) over 10 years ago

With this patch along with the one in r43973, minor GC pauses are now up to 45% shorter in our application.

10.times{ s=Time.now; GC.start_minor; p Time.now-s }

r43972

0.034701
0.034337
0.038741
0.034126
0.037504
0.033009
0.034526
0.033238
0.034232
0.032667

r43973

0.029089
0.027402
0.027296
0.026581
0.028211
0.026294
0.028213
0.030031
0.026412
0.02695

r43974

0.024061
0.021339
0.022207
0.022007
0.022716
0.02303
0.022139
0.021704
0.022118
0.021611

Updated by funny_falcon (Yura Sokolov) over 10 years ago

Look at #8158 . Don't know if it still applies, but I will fix it if you interested in.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0