Issue #8158 has been updated by Nobuyoshi Nakada.


Usaku NAKAMURA wrote:
>  In message "[ruby-core:78595] Re: [Ruby trunk Feature#8158] lightweight structure for loaded features index"
>  on Mon, 12 Dec 2016 06:06:13 +0000, normalperson / yhbt.net wrote:
>  > I'm not sure about the portability of initializing structs
>  > with non-const values for some compilers.  Maybe usa or
>  > somebody with more portability experience can comment.
>  
>  It's OK, at least for VC++.

Other compilers fail, IIRC, Solaris, AIX, HP-UX, or something.

----------------------------------------
Feature #8158: lightweight structure for loaded features index
https://bugs.ruby-lang.org/issues/8158#change-61982

* Author: Yura Sokolov
* Status: Assigned
* Priority: Normal
* Assignee: Nobuyoshi Nakada
----------------------------------------
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--------------------------------
264.patch (14.9 KB)
0001-load.c-reduce-memory-usage-of-loaded_features_index.patch (5.87 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>