Workers, Pages Functions & 10ms CPU Time
Hi,
Studying what could fit in the well-known "10ms CPU Time", I was surprised by some "discrepancies":
- the same code in a worker is going to be (statistically) slightly faster than in a page-function,
- that same function - if the only one - is going to be (statistically) slightly faster than grouped with others even non used.
Of course, it's never much, but enough to make it jump over the 10ms!
Is that logical, even expected? Anyone has done some real extensive tests?
5 Replies
Are you seeing this in the real world, or are you just speculating?
@zegevlier Real world 😃 But I have to agree with you it was a surprise! I will try to reproduce it, or them more accurately, And so for now, I'm just wondering how it could be!
I'd also like to know how much time the normal execution is taking? How close are you to 10ms CPU time normally?
@zegevlier @skye_31 I could not exactly share my code (too many work-in-progress, D1 tries and so on) but I built simple examples
https://worker-native-typescript.tigersway.workers.dev/ & https://pages-native-typescript.pages.dev/count/
Basically the same code, and it goes from 0.5ms to 3.1ms
I'm glad we finally understand each other 😄 But sad I then have no way to regain these little ms I needed.
I'll be working on another architecture/organization.
Thanks anyway
Yep. It's on my list of things to try
I never tried yet the worker site style... But yes, here are next working hours