© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago•
11 replies
juanferreras

profiling timings in next-on-pages (CF workers)

we've been adopting next-on-pages recently and it's been working really, really great (kudos to Dario/James/any other contributors I might be missing!)

(on a somewhat similar note to the messages above) I did want to know if either of you had any methods to reliably profile timings in Cloudflare workers – we were surprised to see that:
const t0 = Date.now();
const data = env.KV.get(key);
const t1 = Date.now();
const t0 = Date.now();
const data = env.KV.get(key);
const t1 = Date.now();

seemed to be reporting
XXX ms
XXX ms
in lab conditions even on cache hits (where in a plain worker we see
XX ms
XX ms
_. Then we realized it wasn't KV but rather the first IO we had (and with the CF Workers security measures, we understand we could be measuring things before that I/O that just wait for the I/O to tick?)
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Access to CF on Pages using Next.js
Cloudflare DevelopersCDCloudflare Developers / next-on-pages
3y ago
Post hog next-on-pages
Cloudflare DevelopersCDCloudflare Developers / next-on-pages
17mo ago
25MB file limit next-on-pages
Cloudflare DevelopersCDCloudflare Developers / next-on-pages
2y ago
anyone using baselime with next-on-pages
Cloudflare DevelopersCDCloudflare Developers / next-on-pages
2y ago