Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(scope-manager): only call Object.entries once for each lib#10647

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

dmichon-msft
Copy link
Contributor

PR Checklist

Overview

Improves performance ofpopulateGlobalsFromLib by ensuring that the referenced lib objects have theirObject.entries arrays precomputed. Also saves on garbage collection since each object only ever has a single array of variable specifications.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@dmichon-msft!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@netlifyNetlify
Copy link

netlifybot commentedJan 13, 2025
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit1210cad
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/67c4f4929f3bf7000801d25a
😎 Deploy Previewhttps://deploy-preview-10647--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (🟢 up 8 from production)
SEO: 98 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to yourNetlify site configuration.

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJan 13, 2025
edited
Loading

View yourCI Pipeline Execution ↗ for commit1210cad.

CommandStatusDurationResult
nx run-many --target=build --exclude website --...✅ Succeeded36sView ↗
nx run-many --target=build --parallel --exclude...✅ Succeeded<1sView ↗
nx run-many --target=clean✅ Succeeded12sView ↗

☁️Nx Cloud last updated this comment at2025-03-03 00:50:59 UTC

Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for doing this!
Let's just go one step further here and remove the need for any runtime calls toObject.entries.
We can just generate all of the lib files as an array of arrays so that there's no calls at all!

Same with the barrel file -- we can generate the map contents as an array of arrays.

@dmichon-msft
Copy link
ContributorAuthor

Since you gave me license to restructure the objects from the individuallib files, I went ahead and separated out the concept of "references to other libs" from individual variable definitions, so that in the (unfortunately rather common) case that developers have specified theirlib array in such a way that a given lib is included multiple times, we only iterate the variables from it once (per source file, still).

@bradzacher
Copy link
Member

I'm happy to go with a bigger refactor of how all of this works.
We should be able to mitigate the cost of loading libs and the cost of defining variables using this approach which is nice.

Just need to get the tests passing and we can move forward with this!

@bradzacherbradzacher added awaiting responseIssues waiting for a reply from the OP or another party enhancementNew feature or request labelsFeb 25, 2025
@dmichon-msft
Copy link
ContributorAuthor

I can rebase/merge this to reconcile the changes to exports that happened a bit back, I just hadn't since the guidance was to leave that to maintainers.

@codecovCodecov
Copy link

codecovbot commentedFeb 26, 2025
edited
Loading

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.44%. Comparing base(9674629) to head(1210cad).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@##             main   #10647   +/-   ##=======================================  Coverage   87.44%   87.44%           =======================================  Files         469      469             Lines       16047    16053    +6       Branches     4649     4650    +1     =======================================+ Hits        14032    14038    +6  Misses       1658     1658             Partials      357      357
FlagCoverage Δ
unittest87.44% <100.00%> (+<0.01%)⬆️

Flags with carried forward coverage won't be shown.Click here to find out more.

Files with missing linesCoverage Δ
...ackages/scope-manager/src/lib/decorators.legacy.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/decorators.ts100.00% <100.00%> (ø)
...ackages/scope-manager/src/lib/dom.asynciterable.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/dom.iterable.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/dom.ts100.00% <ø> (ø)
...ackages/scope-manager/src/lib/es2015.collection.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/es2015.core.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/es2015.generator.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/es2015.iterable.ts100.00% <100.00%> (ø)
packages/scope-manager/src/lib/es2015.promise.ts100.00% <100.00%> (ø)
... and100 more

@bradzacher
Copy link
Member

thanks heaps for this!

@bradzacherbradzacher merged commit355e892 intotypescript-eslint:mainMar 3, 2025
63 checks passed
@JoshuaKGoldberg
Copy link
Member

Before this change, runninghttps://github.com/typescript-eslint/performance:

┌───────┬───────────────────────┬───────────────────────┐│ files │ project (even layout) │ service (even layout) │├───────┼───────────────────────┼───────────────────────┤│ 1024  │ '2.760 s ±  0.006 s'  │ '3.125 s ±  0.011 s'  │└───────┴───────────────────────┴───────────────────────┘

After:

┌───────┬───────────────────────┬───────────────────────┐│ files │ project (even layout) │ service (even layout) │├───────┼───────────────────────┼───────────────────────┤│ 1024  │ '2.478 s ±  0.022 s'  │ '2.829 s ±  0.020 s'  │└───────┴───────────────────────┴───────────────────────┘

Nice 🔥

@dmichon-msftdmichon-msft deleted the object-entries-cache branchMarch 5, 2025 00:02
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsMar 12, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherAwaiting requested review from bradzacher

Assignees
No one assigned
Labels
awaiting responseIssues waiting for a reply from the OP or another partyenhancementNew feature or request
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

⚡️ Performance: Overhead of populateGlobalsFromLib in scope-manager
3 participants
@dmichon-msft@bradzacher@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp