Closed nekolr closed 5 years ago
Final, i found that the performance of the two methods is same, although importScripts
does not block the main thread, but as you said, it does send a new request, so i close this pull request.
Yes, importScripts
does not block the main thread, but blocks execution of service worker.
BTW: thanks for your PR.
See this documentation, https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers#Importing_scripts_and_libraries
I don't know why, it is slower to pack the contents of
sw-toolbox
together into sw.js, but faster to load them separately.