Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
High precision flag #1977
I've worked on an implementation with @hayd .
This PR give perfomance.now() a result in nanoseconds and fits the requirement made in: https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp#Reduced_time_precision
So if flag
hayd left a comment
I do think this warrants a test in https://github.com/denoland/deno/tree/master/tests , maybe two (one for one without). That might be too many tests (since they are expensive), I'm not sure.
You could do a single test:
Yap, hope it will be not so hard.
@ry A scenario i was having in a previous job;
Public API was using multiple inner company libraries which were developped by other teams. The api was meant to be fast and highly available, deployed in autoscaled cloud. But when you auto scale it costs money so the less you execute the best it is for the business.
In integration tests, the api was running with flags like
Also personnaly when i have multiple ideas of writing something i tend to write both and use hrtime time to measure which one is the faster. Like here for example: denoland/deno_std#221
I think benchmarking is the main usecase. Sometimes it's difficult to run with repeats esp. if you're hitting cached IO where the second hit is much faster than the first. It can be useful to accurately time each request or specific function calls to assess where bottlenecks are. In general you don't want this on, but when testing perf you do.