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

Change edge types to numbers #6126

Merged
merged 16 commits into from
Sep 16, 2021
Merged

Change edge types to numbers #6126

merged 16 commits into from
Sep 16, 2021

Conversation

thebriando
Copy link
Contributor

↪️ Pull Request

Eventually we'll work on moving the edge list in the Graph to a buffer, but we need to change edge types to numbers first in order to do that.

🚨 Test instructions

  • Updated unit tests to reflect the new edge type format
  • Tested on a large project

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

@height
Copy link

height bot commented Apr 14, 2021

Link Height tasks by mentioning a task ID in the pull request title or description, commit messages, or comments.

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

@parcel-benchmark
Copy link

parcel-benchmark commented Apr 14, 2021

Benchmark Results

Kitchen Sink ✅

Timings

Description Time Difference
Cold 2.03s +17.00ms
Cached 307.00ms -6.00ms

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

React HackerNews ✅

Timings

Description Time Difference
Cold 10.40s -246.00ms
Cached 503.00ms +1.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/logo.c5bb83f1.png 246.00b +0.00b 5.65s +627.00ms ⚠️

Cached Bundles

No bundle changes detected.

AtlasKit Editor ✅

Timings

Description Time Difference
Cold 1.14m -543.00ms
Cached 1.78s -67.00ms

Cold Bundles

Bundle Size Difference Time Difference
dist/index.774149b9.js 1.78mb -2.00b 🚀 19.65s -389.00ms
dist/index.3f9d78fb.js 694.72kb +15.00b ⚠️ 52.53s -852.00ms
dist/EmojiPickerComponent.0491fb2b.js 146.67kb +0.00b 31.96s +10.24s ⚠️
dist/esm.522ea207.js 33.15kb +0.00b 31.96s +10.24s ⚠️
dist/DatePicker.9038cf9f.js 22.98kb +0.00b 31.96s +10.24s ⚠️
dist/js.0f0bb621.js 17.25kb +0.00b 51.93s +12.49s ⚠️
dist/png-chunks-extract.94b5b9fc.js 3.58kb +0.00b 51.93s +12.49s ⚠️
dist/feedback.e18b45f0.js 1.77kb +0.00b 31.95s +10.24s ⚠️
dist/workerHasher.567cfc57.js 1.63kb +0.00b 31.96s +10.24s ⚠️
dist/heading6.b3b946d1.js 1.51kb +0.00b 31.95s +10.24s ⚠️
dist/heading5.e617db66.js 1.38kb +0.00b 31.95s +10.24s ⚠️
dist/expand.1f17de7f.js 1.29kb +0.00b 31.95s +10.24s ⚠️
dist/heading4.62b9719b.js 1.27kb +0.00b 31.95s +10.24s ⚠️

Cached Bundles

Bundle Size Difference Time Difference
dist/index.e288bc82.js 1.78mb +2.00b ⚠️ 19.75s -67.00ms
dist/index.96a60c6b.js 694.71kb -15.00b 🚀 52.75s -289.00ms
dist/Modal.2b19bf46.js 45.31kb +15.00b ⚠️ 52.17s -261.00ms

Three.js ✅

Timings

Description Time Difference
Cold 7.42s -61.00ms
Cached 444.00ms +30.00ms ⚠️

Cold Bundles

No bundle changes detected.

Cached Bundles

No bundle changes detected.

Click here to view a detailed benchmark overview.

@joeyslater
Copy link
Contributor

You may want to look at dumpGraphToGraphViz as I believe the colors won't map anymore

packages/core/core/src/Graph.js Outdated Show resolved Hide resolved
@@ -6,18 +6,19 @@ import type {TraversalActions, GraphVisitor} from '@parcel/types';
import assert from 'assert';
import nullthrows from 'nullthrows';

export type GraphOpts<TNode, TEdgeType: string | null = null> = {|
type NullEdgeType = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should not support the null edge type at all, and just have users/extenders always specify the types of edges the way they do nodes.

Copy link
Contributor

Choose a reason for hiding this comment

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

@thebriando thebriando closed this Jun 4, 2021
@thebriando
Copy link
Contributor Author

Closing this for now since this will be involved in a different task for buffer-backed edges in the graph.

@wbinnssmith
Copy link
Contributor

Why did we close this? Couldn't this be landed separately from upcoming work?

@thebriando
Copy link
Contributor Author

Why did we close this? Couldn't this be landed separately from upcoming work?

I think I closed this because we thought we were close to opening a PR for the main work 😞 which includes the numeric edge types, and landing this by itself didn't have any significant performance impact.

@wbinnssmith
Copy link
Contributor

didn't have any significant performance impact.

It will make the work reviewable though, yeah?

@thebriando thebriando reopened this Aug 5, 2021
@thebriando
Copy link
Contributor Author

It will make the work reviewable though, yeah?

Yeah good point, I reopened it.

@lettertwo lettertwo force-pushed the bdo/number-edgetypes branch 2 times, most recently from a97bcc1 to c0b7651 Compare September 13, 2021 21:54
* v2: (42 commits)
  Remove dead link to docs in diagnostic (#6913)
  Fix engines.parcel in SVG packager (#6911)
  Use imported Readable flow type instead of global (#6910)
  Use non-deprecated SVGO options in HTMLNanoOptimizer (#6785)
  Use yarnpkg registry for all the things (#6908)
  Fix issue about loading configs from tsconfig.json (#6881)
  Add `@section` to Compressor type (#6885)
  Parcel API improvements (#6866)
  Use stream-browserify for polyfilling instead (#6863)
  Add support for compressor plugins (#6776)
  Support for inline style attributes and inline scripts in SVG (#6797)
  Bump less (#6852)
  Make sure (non-React) SVGs are in separate bundles (#6757)
  Add support for injecting manifest into service workers (#6798)
  Fix 'does not export default' error with scope hoisting and url/worklet pipeline (#6803)
  Remaining cargo clippy fixes (#6829)
  Lazily install sharp only when needed (#6816)
  More cargo clippy suggestions (#6811)
  Don't emit runtime manifest for inline child bundles (#6807)
  Apply suggestions from rust-clippy (#6256)
  ...
@wbinnssmith
Copy link
Contributor

This should be able to land before #6922 I believe. Looks like there's a small lint issue.

@thebriando
Copy link
Contributor Author

This should be able to land before #6922 I believe. Looks like there's a small lint issue.

Should be fixed now 😄

@thebriando thebriando merged commit b9294c4 into v2 Sep 16, 2021
@thebriando thebriando deleted the bdo/number-edgetypes branch September 16, 2021 01:05
lettertwo added a commit that referenced this pull request Sep 22, 2021
* v2:
  Upgrade Flow to 0.160.1 (#6964)
  Only use error overlay if there's a document (#6960)
  Don't fail when HTML tags are implied (#6752)
  Reorder resolveOptions() env priority (#6904)
  Change edge types to numbers (#6126)
  Bump swc (#6848)
  Print diagnostics for scope hoisting bailouts at verbose log level (#6918)
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