Skip to content
  • nagachika's avatar
    012015d7
    merge revision(s) b8f0dc59: [Backport #18599] · 012015d7
    nagachika authored
    
    
    	rb_provide_feature: Prevent $LOADED_FEATURES from being copied
    
    	[Bug #18599]
    
    	`vm->loaded_features` and `vm->loaded_features_snapshot` both share the
    	same root. When a feature is pushed into `loaded_features`, the sharing
    	is broken and `loaded_features` is copied.
    
    	So an application requiring 1000 files, will allocate 1000 arrays of
    	increasing size, which is very wasteful.
    
    	To avoid this, we first clear the snapshot, so that `loaded_features`
    	can directly be pushed into.
    
    Co-Authored-By: default avatarPeter Zhu <peter.zhu@shopify.com>
    	---
    	 load.c | 4 ++++
    	 1 file changed, 4 insertions(+)
    012015d7
    merge revision(s) b8f0dc59: [Backport #18599]
    nagachika authored
    
    
    	rb_provide_feature: Prevent $LOADED_FEATURES from being copied
    
    	[Bug #18599]
    
    	`vm->loaded_features` and `vm->loaded_features_snapshot` both share the
    	same root. When a feature is pushed into `loaded_features`, the sharing
    	is broken and `loaded_features` is copied.
    
    	So an application requiring 1000 files, will allocate 1000 arrays of
    	increasing size, which is very wasteful.
    
    	To avoid this, we first clear the snapshot, so that `loaded_features`
    	can directly be pushed into.
    
    Co-Authored-By: default avatarPeter Zhu <peter.zhu@shopify.com>
    	---
    	 load.c | 4 ++++
    	 1 file changed, 4 insertions(+)
Loading