Linear time increase per promise when resolving concurrently using Promise.all?

I have a method that steps through a JSON payload to run computation on some data within that payload. When I create 100 promises of that method and then pass them into Promise.all(), it seems that for every promise that is resolved concurrently, the next one takes a bit longer to resolve.

This is not specific to my method, I have tried a similar thing with a public API that returns simple JSON data. In calling that API concurrently using Promise.all I observed the same thing… every consecutive promise would take longer and longer to resolve.

Here is a simple code snippet to illustrate what I’m doing:

const axios = require('axios');

const getSomeData = async () => {
  try {
    await axios.get('https://some.api.com');
  } catch (error) {
    console.log('Failed to get data...');
  }
};

const promiseList = [];

for (let i = 0; i < 100; i += 1) {
  promiseList.push(new Promise(async (res) => {
    const startTime = performance.now();
    await getSomeData();
    const stopTime = performance.now();
    console.log(`time taken by promise: ${stopTime - startTime}`);
    res();
  }));
}

const main = async () => {
  const startTime = performance.now();
  await Promise.all(promiseList);
  const stopTime = performance.now();
  console.log(`total time taken: ${stopTime - startTime}`);
};

main();

This of course is a pretty pointless method but I created it strictly to observe how promises behave when running concurrently and how much performance benefit there is versus running sequentially (it’s obviously a significant improvement).

My question is, what would cause every consecutive promise to take longer and longer until all the promises are resolved? In which case if I were to run this again, it would reset the time taken back to around 200ms for the first promise, before it started increasing again until the last promise would take around 600ms to resolve.

Is this just the nature of single threaded Javascript execution and concurrency? I am really interested in hearing a more in depth explanation of this phenomenon.