Apologies if this is the wrong place to ask.
For my experiment, I have a single-page application and a multi-page application. I am testing them with an exponential distributed delay throttling. The idea is that individual chunks are delayed by a random number sampled from an exponential distribution. So, when a HTTP/GET request comes in, it gets split into 200 byte chunks and each chunk is delayed. Basically each request for a resource e.g. HTML/CSS/JS is a sum of exponential distributed delays.
Now, when I did a test of a 100 page loads and got the mean.
My question is why is the SPA vs MPA without delay, SPA is around 4 times faster but then SPA vs MPA with delay is only 2 times faster?
To do a simulation:
User visits a website from his browser, he makes a HTTP request for the root HTML first, which makes subsequent requests for style sheets and scripts to load the page.
Taking the first request for the root HTML, (for specific details) this TCP stream is fed into a SOCKS server before going out to the web server. The stream takes 200 byte chunks at a time and delays it, (and without blocking) keeps taking another chunk and delays it. It also checks if any previous chunk will overlap, if so it will send it out the same time.
The web server gets the delayed request and sends a reply back (in this case the HTML file) to the SOCKS server, where it will delay it again.
At step 2, say we have a 1000 byte stream, it will take 200 byte and delay it in the background, take another 200 byte and delay that in the background too, and keep doing it. Meanwhile it will check overlaps, so if the first chunk has a delay (plus current time) that is greater than the delay (plus current time) of the second, meaning the second will get sent first. We want to delay the second chunk the same time, so it gets sent in order.
I hope that makes sense. Please let me know if it doesn't.