Sleitnick / Knit

Lightweight game framework for Roblox
https://sleitnick.github.io/Knit/
MIT License
566 stars 93 forks source link

Add optional affix-checker to reduce memory-usage #217

Closed zoop1015 closed 1 year ago

zoop1015 commented 1 year ago

As implied; added an optional affix-checker if it's in the needs to exclude specific redundant module-requirements.

eAi commented 1 year ago

affix seems an odd name for this. Also not sure the use of this - can you explain more?

zoop1015 commented 1 year ago

Currently all of the methods that handle requiring services/controllers for you require all modules derived by the given parent-folder recursively/not-recursively by default, and in the case of where you had, let's say, a service alongside a serviceConfig, this means that the configuration modules are getting required reduntantly as-well, which causes unecessary memory to be duplicated.

The affix is a term used to represent either a 'suffix' or a 'prefix', so e.g. ServiceExample$ or ^ExampleService would be applicable inputs.