perf: bind to this some methods in the tasks execution code path
[poolifier.git] / src / pools / abstract-pool.ts
index 1ce8c25ec8f3a783c2ce0802e39d81bd60e82bf2..f904af93183840b89edbf166dd02a61fa7e7ec1d 100644 (file)
@@ -73,6 +73,12 @@ export abstract class AbstractPool<
     this.checkNumberOfWorkers(this.numberOfWorkers)
     this.checkFilePath(this.filePath)
     this.checkPoolOptions(this.opts)
+
+    this.chooseWorker.bind(this)
+    this.internalExecute.bind(this)
+    this.checkAndEmitBusy.bind(this)
+    this.sendToWorker.bind(this)
+
     this.setupHook()
 
     for (let i = 1; i <= this.numberOfWorkers; i++) {