300x performance improvement deepkit/injector, 20x faster and smaller deepkit/rpc, new packages deepkit/bench, deepkit/run #640
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress.
deepkit/injector was rewritten in its core. We have a lot of performance improvements:
In general getting the reference to the DI factory directly allows to get the most performance increase. Doing it like this
makes resolving dependencies optimal. There is no faster way, even writing it manually is not faster. This is the most optimal way to retrieve a service instance. By assigning the factory function now directly into dependency resolution makes the whole container almost optimal in performance (meaning there is no way to make it any faster). Currently it hovers around 100mio ops/s, which is nearly identical to doing
return instance ||= new Service()
;deepkit/rpc protocol was fundamentally changed and got a size improvment of 20x. A single action calls without parameters is now only 3 bytes (vs ~80bytes before).
new Promise
is slow and has max 7mio ops/s)deepkit/run internal package to execute typescript in an easy way
deepkit/bench new package for benchmarks. we add now scripts to
packages/*/benchmarks
directly in our repo, which can be executed like