Skip to content

Reduce redundancy in the RequestGraph's file nodes#9360

Merged
gorakong merged 8 commits into
v2from
gkong/reduce-requestGraph-fileNodes
Nov 3, 2023
Merged

Reduce redundancy in the RequestGraph's file nodes#9360
gorakong merged 8 commits into
v2from
gkong/reduce-requestGraph-fileNodes

Conversation

@gorakong

@gorakong gorakong commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

↪️ 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
Comment thread packages/core/core/src/projectPath.js Outdated
Comment thread packages/core/core/src/projectPath.js Outdated
@gorakong gorakong requested a review from lettertwo November 2, 2023 22:53
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