-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace Date
with perf-hooks
for time measurement
#649
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! What's still missing?
223c345
to
737ea62
Compare
I wanted to verify that this can actually be used to create a benchmarking tool (see #650). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Could you add a bit more documentation, especially to functions exported from the lib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thank you!
Currently, Jayvee uses Date to measure the duration of hooks, blocks and pipelines.
With this PR, the Jayvee interpreter now sets "performance marks" at relevant points during execution (before/after blocks/pipelines) and then measures the time between these marks. For now, marks are named with the following schema, with the goal of "encoding" the mark's location in the name:
This isn't final though, and I other ideas are welcome.
IMO this is a better approach than using the standard Jayvee hooks. Quoting #636 (comment):
I hope, that performance hooks can be used to implement a benchmarking tool using PerformanceObserver. That need's further testing though, so this PR is a draft for now.