Cacheable preloader patchers #213
ghorsington
started this conversation in
BepInEx 6 proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Preloader patchers allow one to modify managed assemblies using cecil. While it has proven useful in a multitude of situations, the fact is, reading and writing assemblies with cecil imposes a load time penalty. Many times, however, cecil patchers act as pure functions: they apply a deterministic change without any side-effects.
To speed up chainloader, a notion of pure chainloaders should be considered. A pure chainloader has the following defining property:
This allows to cache assemblies for which pure chainloaders have been applied. When applying chainloaders, pure chainloaders are applied first.
The API is not yet thought of since it depends on the new Chainloader V2 API (discussion not open yet). In general, purity should likely be implemented as an attribute or as a property that asserts the chainloader is pure. This is because there is no viable way to determine purity for an arbitrary chainloader at runtime.
Beta Was this translation helpful? Give feedback.
All reactions