When creating the blobs in Github, the plugin is currently doing 1 request at a time and each request waits for the previous before starting.
This flow can be optimised to perform multiple requests in parallel massively improving the speed of the upload.
Note: These requests done in parallel should be limited to a specific maximum number of parallel requests, otherwise the requests will be killed by the "browser".
Suggested solution
Determine the maximum number of parallel requests the figma browser window allows without killing requests
Perform the requests to create the blobs in batches of that specific maximum amount allowed
Created a "Rate Limiter" class to prevent all HTTP requests to be sent at the same time
Configured rate limiter to handle the request pool at a maximum rate of 20 concurrent jobs when creating github blobs
Note: This rate limit was tested against even higher rates, but at 30 concurrent requests there were some jobs failing already. 25 still worked, but to be safe the plugin will handle a maximum will be capped at 20 maximum simultaneous requests.
Description
When creating the blobs in Github, the plugin is currently doing 1 request at a time and each request waits for the previous before starting.
This flow can be optimised to perform multiple requests in parallel massively improving the speed of the upload.
Suggested solution