-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: base measureFunction API #271
Conversation
|
Performance Comparison ReportSignificant Changes To Duration
Show details
Meaningless Changes To DurationShow entries
Show details
Changes To CountThere are no entries Added Scenarios
Show details
Removed ScenariosThere are no entries |
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.
Where are we with this exactly? It's marked as WIP and I was just wandering if that's something you're still working on? @mdjastrzebski
@Xiltyn This is an new feature/direction for Reassure, where it allow for testing performance of node apps and/or JS libraries (e.g. open source). This PR is about prototyping the API, and since I am limited on OSS time, it is progressing slowly. However, I think that this is very interesting niche to explore |
f47dd59
to
7c9d232
Compare
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 like a good direction. Thinking about whether we should incorporate some warmup code – but does it make sense in our case where we disable JIT and force GC?
@thymikee what do you mean by warmup code? The worst (first) run of the function will be dropped, similar to how we process render measurements. |
@mdjastrzebski e.g. here: https://github.com/krausest/js-framework-benchmark#about-the-benchmarks. AFAIK warmup is helpful when preparing the JS engine to fire up JIT, but maybe there's more to it |
14dd779
to
e0766cf
Compare
fix: lint refactor: rename `measureExecution` to `UNSTABLE_measurePerformance` feat: measurePerformanceInternal executs code number of times feat: allow setting custom measure code refactor: re-structure measure functions refactor: cleanup tests refactor: rename measure results type
e0766cf
to
d0d175f
Compare
@mdjastrzebski now ready for review, with a fallback value of |
Looks good! Let's merge it! 🦙🏄♂️ |
Summary
Resolves #224
API for measuring execution time of regular JS functions. It works similarly to render measures, but instead of using
React.Profiler
to measure renders stats of component, it just measures the execution duration of JS function.It's intended to be used for any JS apps (not only React/RN) or libraries.
Scope:
main
performance.now()
type: MeasureType
toPerformanceEntry
andCompareEntry
Test plan
Added unit tests and perf tests using
measureFunction