sirko-io / engine

Benefit from new browsers' technologies to speed up your site
GNU General Public License v3.0
43 stars 3 forks source link

Reading speed from service worker #45

Open m0-n opened 5 years ago

m0-n commented 5 years ago

Upon preliminary analysis, reading speed of the service worker in sirko-io seems comparable to network. Low latency, but also low reading speed.

Data: image

Total load time demo: 1.0 - 1.5s

Is that a bug / some IO blocking in the SW ? How can that number be brought down to 20-30ms as normal read operations?

dnesteryuk commented 5 years ago

@stefanspirkl I assume this image wasn't in the cache :thinking: Once the engine makes the prediction, the browser needs time to download content. If a user moves too fast between pages, there won't be enough time for downloading. Cached content can be checked in Application -> Cache storage.

dnesteryuk commented 5 years ago

@stefanspirkl I double checked this case and found an interesting observation

Untitled

Before visiting the predicted page, I removed avatar2.png from the cache storage, it took only 6 ms (2 ms were spent on downloading from the disk cache) to deliver it. Meanwhile, the other images were delivered within 30 ms.

I see from your example that it took 386 ms to deliver post01.jpg. Meanwhile, 27 ms were needed to get it from the disk cache. So, what was happening other 359 ms?!

My first assumption is a restriction to a number of concurrent requests to the cache storage.

dnesteryuk commented 5 years ago

Hi @stefanspirkl finally, I got time to investigate this issue. Here is a first result https://nesteryuk.info/2019/05/25/chrome-cache-storage-vs-disk-cache.html I will keep you updated when I find something more :wink: