Project

General

Profile

Actions

Feature #8158

closed

lightweight structure for loaded features index

Added by funny_falcon (Yura Sokolov) about 11 years ago. Updated about 6 years ago.

Status:
Closed
Target version:
-
[ruby-core:53688]

Description

Use lightweight structure for loaded_features index:

  • use hand made simple hash structure, which uses only one memory chunk,
  • do not store feature name string, only hash of it, since loaded_feature_path
    will recheck feature name on hash collision
  • use single linked lists instead of arrays for storing features indices.
  • store this lists inside one array, using array's indices as a reference.

While startup speedup improvement is relatively small compared current implementation,
this one does not need any Ruby Objects at all, so that there is no presure on GC.

https://github.com/ruby/ruby/pull/264.patch
https://github.com/ruby/ruby/pull/264.diff
https://github.com/ruby/ruby/pull/264


Files


Related issues 1 (0 open1 closed)

Related to Ruby master - Feature #14460: Speed up `require` and reduce memory usageClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0