Skip to content

Comments

Speed up rebuilding the loaded feature index#7699

Merged
jeremyevans merged 1 commit intoruby:masterfrom
jeremyevans:speedup-rebuild-loaded-feature-index-19246
Apr 14, 2023
Merged

Speed up rebuilding the loaded feature index#7699
jeremyevans merged 1 commit intoruby:masterfrom
jeremyevans:speedup-rebuild-loaded-feature-index-19246

Conversation

@jeremyevans
Copy link
Contributor

Rebuilding the loaded feature index slowed down with the bug fix for #17885 in 79a4484. The slowdown was extreme if realpath emulation was used, but even when not emulated, it could be about 10x slower.

This adds loaded_features_realpath_map to rb_vm_struct. This is a hidden hash mapping loaded feature paths to realpaths. When rebuilding the loaded feature index, look at this hash to get cached realpath values, and skip calling rb_check_realpath if a cached value is found.

Fixes [Bug #19246]

Rebuilding the loaded feature index slowed down with the bug fix
for #17885 in 79a4484.  The
slowdown was extreme if realpath emulation was used, but even when
not emulated, it could be about 10x slower.

This adds loaded_features_realpath_map to rb_vm_struct. This is a
hidden hash mapping loaded feature paths to realpaths. When
rebuilding the loaded feature index, look at this hash to get
cached realpath values, and skip calling rb_check_realpath if a
cached value is found.

Fixes [Bug #19246]
@jeremyevans jeremyevans merged commit 1f115f1 into ruby:master Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants