-
Notifications
You must be signed in to change notification settings - Fork 236
Description
Whilst upgrading 3rd party dependencies and target framework as part of #1024 I excluded upgrading JSPool from 2.0.1 to 4.0.0 due to braking changes.
Upon further investigation the JSPool package appears to be abandonware (last release ~10 years ago, last commit ~8 years ago).
Whilst researching alternatives I found that there is no way to reset an IJsEngine object provided by JavaScriptEngineSwitcher to it's original state and it's essentially dropped from the pool, negating the ability for the JavaScriptEnginePool to reuse the object. There could be some performance gains from the original initialisation of the object pool but I wonder if such an approach is necessary given the availability of decent compute both locally and remote.
I propose a refactor as follows:
- Remove the concept of JavaScriptEngine pooling; and
- Change the
GetJavaScriptEnginePoolto invoke afuncoractionto return a new engine provided byJavaScriptEngineSwitcher. This could be configurable so that users could provide theirfunc,actionor options/configuration to customise theIJsEnginereturned fromJavaScriptEngineSwitcher.
Thoughts and feedback greatly appreciated, especially if I've misunderstood the purpose of the JavaScriptEnginePool.