Closed querielo closed 1 year ago
Thanks for putting this together. If the motivation for this PR is to reduce the time to upload files, do you have any stats about the improvements this PR brings?
I will take a look once I have a few chunk of time this week. It would be great to get stats as Will mentioned
Thanks for putting this together. If the motivation for this PR is to reduce the time to upload files, do you have any stats about the improvements this PR brings?
Yes, right now, we have hundreds of files (bundles) that can be rebuild. We cannot simply combine them into one bundle by webpack/grunt/gulp/... because there are many global variables in legacy code that have to be defined in strict order. So, if we change something in structure of bundles a developer can spend up to 15 minutes to upload all bundles.
So, if we change something in structure of bundles a developer can spend up to 15 minutes to upload all bundles.
So what speed ups are you seeing with this PR? If it's ~15 minutes to upload without the PR, what is it with the PR?
So, if we change something in structure of bundles a developer can spend up to 15 minutes to upload all bundles.
So what speed ups are you seeing with this PR? If it's ~15 minutes to upload without the PR, what is it with the PR?
Yes. With PR it requires a few minutes instead of 15-20 minutes. Right now, we patch playcanvas-sync while npm install
I've just tried running this from your branch @querielo and get the following error:
/Users/syau/Snapchat/Dev/querielo/playcanvas-sync/src/utils/common-utils.js:295
asyncPools.set(key, new AsyncPool(concurrency, rateLimit));
^
ReferenceError: AsyncPool is not defined
at new CUtils.getAsyncPool (/Users/syau/Snapchat/Dev/querielo/playcanvas-sync/src/utils/common-utils.js:295:41)
at new OverwriteAllRemoteWithLocal (/Users/syau/Snapchat/Dev/querielo/playcanvas-sync/src/sync-commands/overwrite-all-remote-with-local.js:15:26)
at cb (/Users/syau/Snapchat/Dev/querielo/playcanvas-sync/pcsync.js:92:16)
at Object.wrapUserErrors (/Users/syau/Snapchat/Dev/querielo/playcanvas-sync/src/utils/common-utils.js:112:35)
at /Users/syau/Snapchat/Dev/querielo/playcanvas-sync/src/sync-commands/sync-utils.js:51:24
at Interface._onLine (node:readline:485:5)
at Interface._line (node:readline:864:8)
at Interface._ttyWrite (node:readline:1216:14)
at ReadStream.onkeypress (node:readline:288:10)
at ReadStream.emit (node:events:527:28)
Hello, @yaustar @willeastcott
It seems the PR is relevant again. Probably, someone might have tried to DDoS the Playcanvas Editor. And you set up yesterday request limits on Cloudfront based on user IP. I overlooked this (sorry), and inadvertently put myself under the strict rate limit as per https://developer.playcanvas.com/en/user-manual/api/#rate-limiting
Please consider this PR again 🙏
ReferenceError: AsyncPool is not defined
Fixed.
@willeastcott or https://github.com/yak32 will have to take over review of the PR 😄
The PR adds AsyncPool that is used to limit the number of requests to a server and make 4 concurrent requests. For example, it is especially important if we want to reduce time that is required to upload files to Playcanvas Editor.