Skip to content
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

Reduce redundancy in the RequestGraph's file nodes #9360

Merged
merged 8 commits into from
Nov 3, 2023

Conversation

gorakong
Copy link
Contributor

@gorakong gorakong commented Nov 2, 2023

↪️ Pull Request

This PR reduces redundancy in the RequestGraph's file nodes (which account for close to 50% of the RequestGraph's nodes) by getting rid of the value object in each of them, since these can be derived from their IDs. On a large app, this nets us a 6.3% reduction in the size of the serialized RequestGraph.

💻 Examples

Before:

  {
    id: 'node_modules/glob-parent/index.js',
    type: 'file',
    value: { filePath: 'node_modules/glob-parent/index.js' }
  }

After:

{ id: 'node_modules/glob-parent/index.js', type: 'file' }

@gorakong gorakong requested a review from devongovett November 2, 2023 19:53
@gorakong gorakong changed the title Reduce redundancy in file nodes in the RequestGraph Reduce redundancy in the RequestGraph's file nodes Nov 2, 2023
packages/core/core/src/projectPath.js Outdated Show resolved Hide resolved
@gorakong gorakong requested a review from lettertwo November 2, 2023 22:53
@gorakong gorakong merged commit 406650e into v2 Nov 3, 2023
16 checks passed
@mischnic mischnic deleted the gkong/reduce-requestGraph-fileNodes branch November 3, 2023 09:00
@alshdavid alshdavid mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants