[#116016] [Ruby master Bug#20150] Memory leak in grapheme clusters — "peterzhu2118 (Peter Zhu) via ruby-core" <ruby-core@...>
Issue #20150 has been reported by peterzhu2118 (Peter Zhu).
7 messages
2024/01/04
[#116382] [Ruby master Feature#20205] Enable `frozen_string_literal` by default — "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Issue #20205 has been reported by byroot (Jean Boussier).
77 messages
2024/01/23
[ruby-core:116163] [Ruby master Feature#20177] Optimized $LOADED_FEATURES.include?
From:
"palkan (Vladimir Dementyev) via ruby-core" <ruby-core@...>
Date:
2024-01-10 23:06:27 UTC
List:
ruby-core #116163
Issue #20177 has been reported by palkan (Vladimir Dementyev). ---------------------------------------- Feature #20177: Optimized $LOADED_FEATURES.include? https://bugs.ruby-lang.org/issues/20177 * Author: palkan (Vladimir Dementyev) * Status: Open * Priority: Normal ---------------------------------------- I'd like to propose adding the optimized `$LOADED_FEATURES.include?` (not the one provided by the Array class) for faster feature checks in large codebases (when there are thousands of entries in the features list). I hit this problem while working on [require-hooks](https://github.com/ruby-next/require-hooks#results). We can use the internal `vm->loaded_features_realpaths` Hash to achieve faster lookups (it's used by MRI's `require / load` mechanism). Alternatively to overriding the `#include?` method, we can introduce a custom API similar to how `$LOAD_PATH.resolve_feature_path` has been introduced (e.g., `$LOADED_FEATURES.feature_loaded?(path)`); but since the behaviour is similar to `Array#include?`, I'd suggest re-using it (and stay backward compatible). -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/