-
Notifications
You must be signed in to change notification settings - Fork 406
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
perf(store): replace instanceof Function
with typeof
#2247
Conversation
`typeof` avoids prototype chain checks and type coercion, which is faster: ``` instanceof Function x 104,665,819 ops/sec ±4.90% (44 runs sampled) typeof function x 169,867,932 ops/sec ±6.42% (55 runs sampled) ```
☁️ Nx Cloud ReportCI is running/has finished running commands for commit e0e9245. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targetsSent with 💌 from NxCloud. |
commit: |
BundleMonFiles updated (1)
Unchanged files (5)
Total files change +55B +0.04% Groups updated (2)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (NGXS Plugins)Unchanged files (9)
No change in files bundle size Unchanged groups (1)
Final result: ✅ View report in BundleMon website ➡️ |
BundleMon (Integration Projects)Unchanged files (3)
Total files change -15B -0.01% Final result: ✅ View report in BundleMon website ➡️ |
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 perf tweak. You just need to update the changelog in this PR too.
Code Climate has analyzed commit e0e9245 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 95.4% (0.0% change). View more on Code Climate. |
typeof
avoids prototype chain checks and type coercion, which is faster:Btw fastest benchmarked checks were: