gcping icon indicating copy to clipboard operation
gcping copied to clipboard

Move to service workers for request to parallelize

Open crwilcox opened this issue 3 years ago • 2 comments

I think we could get the exec time down for gcping, also make it seem a bit more responsive if we used service workers for the requests?

https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers

crwilcox avatar Nov 17 '21 22:11 crwilcox

I don't think we need to use web workers. Currently the code awaits each region, so I think simply sending requests to all regions and await for Promise.all() later would parallelize the request.

https://github.com/GoogleCloudPlatform/gcping/blob/main/web/src/js/gcping.js#L93

yuryu avatar Nov 21 '22 19:11 yuryu

I think that is correct. The code linked to is the code that needs changing, and this issue may have been overly prescriptive in how to address :)

crwilcox avatar Dec 27 '22 18:12 crwilcox