-
Notifications
You must be signed in to change notification settings - Fork 142
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
⚡ Performance Friday Reduce Bundle Size #2875
⚡ Performance Friday Reduce Bundle Size #2875
Conversation
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2875 +/- ##
==========================================
- Coverage 93.68% 93.67% -0.01%
==========================================
Files 266 266
Lines 7584 7591 +7
Branches 1687 1688 +1
==========================================
+ Hits 7105 7111 +6
- Misses 479 480 +1 ☔ View full report in Codecov by Sentry. |
/to-staging |
🚂 Branch Integration: starting soon, median merge time is 12m Commit ff5491efd3 will soon be integrated into staging-30. Use |
…aging-30 Integrated commit sha: ff5491e Co-authored-by: roman.gaignault <roman.gaignault@datadoghq.com>
🚂 Branch Integration: This commit was successfully integrated Commit ff5491efd3 has been merged into staging-30 in merge commit a6e3950971. Check out the triggered pipeline on Gitlab 🦊 |
Motivation
Avoid using useless ?. to reduce bundle size
While those operators are quite nice additions to ES, they can produce an unexpected amount of code. Example:
f?.stop()
// bundled as (30 bytes):
null===f||void 0===f||f.stop()
Changes
Instead, using standard “boring” syntax is usually generating less code:
if (f) f.stop()
// bundled as (11 bytes):
f&&f.stop()
Testing
I have gone over the contributing documentation.