Skip to content

Conversation

@frrist
Copy link
Member

@frrist frrist commented Apr 28, 2022

Why

Used in a test branch of lily filecoin-project/lily#880 where we observed a significant speed up (from mins to milliseconds) in its processing pipeline (diffing actor states, state-trees, miner and market HAMTs).

What

doParallelDiffNode is mostly a copy of diffNode with the addition of an errgroup to parallelize recursive access. doparallelDiffNode is called from within diffAndAssertLength for all tests.
ParallelDiff accepts a maxWorkers that limits (approximately) the number of goroutines created.

@frrist frrist self-assigned this Apr 28, 2022
@frrist frrist marked this pull request as ready for review April 28, 2022 02:38
@frrist frrist marked this pull request as draft April 28, 2022 16:21
@frrist frrist force-pushed the frrist/parallel-diff branch from 8b26370 to bbeb31c Compare May 4, 2022 15:42
@frrist frrist force-pushed the frrist/parallel-diff branch from bbeb31c to 6d7ae35 Compare May 4, 2022 15:44
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

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

Also, in general, you need to either:

  1. Select on the context everywhere.
  2. Ensure that you drain channels everywhere.

It's usually easier to select on the context and just let everything shut down async. But it's cleaner to carefully drain channels. Up to you.

frrist added 4 commits May 4, 2022 12:30
- seems CI is resource contratined, these test pass locally in ~30sec
@frrist frrist marked this pull request as ready for review May 4, 2022 18:33
@frrist frrist merged commit d7766f8 into master May 5, 2022
@frrist frrist deleted the frrist/parallel-diff branch May 5, 2022 19:12
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.

3 participants