Reuse the Worker between requests. This adds a listener for a "fetch" message in order to start the BQ fetch and data transform. I create a new MessageChannel for each request to make it simple for notifying the correct Promise when the work is done.
This should save a few seconds off each of the requests that was blocked by startup overhead.
Reuse the Worker between requests. This adds a listener for a "fetch" message in order to start the BQ fetch and data transform. I create a new
MessageChannel
for each request to make it simple for notifying the correct Promise when the work is done. This should save a few seconds off each of the requests that was blocked by startup overhead.