From: "mame (Yusuke Endoh)" Date: 2012-03-31T10:29:41+09:00 Subject: [ruby-core:43974] [ruby-trunk - Feature #5427][Assigned] Not complex patch to improve `require` time (load.c) Issue #5427 has been updated by mame (Yusuke Endoh). Status changed from Open to Assigned Assignee set to nobu (Nobuyoshi Nakada) Sorry I don't catch up the discussion. What's the status? The proposal is COMPLETELY compatible? It may be helpful for me to create a short summary of the proposal and discussion. I tentatively assign this to nobu. Any other committer is interested in this issue? -- Yusuke Endoh ---------------------------------------- Feature #5427: Not complex patch to improve `require` time (load.c) https://bugs.ruby-lang.org/issues/5427#change-25495 Author: funny_falcon (Yura Sokolov) Status: Assigned Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: Target version: Currently `loaded_features` are unsorted, so that `rb_feature_p` ought to iterate over all `loaded_features` to figure: is requested feature loaded? After this patch `loaded_features` is kept sorted by basename without extension (/usr/lib/ruby/asdf.rb => asdf). When `rb_feature_p` start its check, it goes straight to the first item with matching basename (using binary search) and stops after last. Methods `$LOADED_FEATURES.<<` and `$LOADED_FEATURES.push` are overriden to keep sort order. `push` accepts only 1 parameter, but it seems that no one pass more to it. Currently I choose to consider characters of basename in right to left order, but it could be changed, I think. https://gist.github.com/1272991 https://github.com/ruby/ruby/pull/51 -- http://bugs.ruby-lang.org/