Skip to content

Parallelized builds #3629

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

Merged
merged 5 commits into from
Aug 14, 2020
Merged

Parallelized builds #3629

merged 5 commits into from
Aug 14, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

@schmidt-sebastian schmidt-sebastian commented Aug 13, 2020

This changes the Firestore build pipeline to run in parallel for most operations.

  • First commit is the dist/ directory with the old files
  • Second commit is the rollup changes
  • Third commit is after re-running the build (with minimal changes as the Node ESM2017 build now uses 'const')
  • Fourth commit is removal of the dist/ files

Dedicated to @samtstern

@changeset-bot
Copy link

changeset-bot bot commented Aug 13, 2020

💥 No Changeset

Latest commit: 4973cac

Merging this PR will not cause any packages to be released. If these changes should not cause updates to packages in this repo, this is fine 🙂

If these changes should be published to npm, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/parallelbuilds branch from b8d5b55 to 1f841b3 Compare August 13, 2020 17:27
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Aug 13, 2020

Binary Size Report

Affected SDKs

  • @firebase/app

    Type Base (c6abcd8) Head (49b9efb) Diff
    browser 11.1 kB 11.1 kB +1 B (+0.0%)
    esm2017 9.46 kB 9.46 kB +1 B (+0.0%)
    lite 9.11 kB 9.11 kB +1 B (+0.0%)
    lite-esm2017 7.75 kB 7.75 kB +1 B (+0.0%)
    main 10.1 kB 10.1 kB +1 B (+0.0%)
    module 11.0 kB 11.0 kB +1 B (+0.0%)
    react-native 9.87 kB 9.87 kB +1 B (+0.0%)
  • @firebase/firestore

    Type Base (c6abcd8) Head (49b9efb) Diff
    browser 249 kB 249 kB +163 B (+0.1%)
    esm2017 195 kB 195 kB +119 B (+0.1%)
    main 474 kB 474 kB +183 B (+0.0%)
    module 246 kB 246 kB +163 B (+0.1%)
    react-native 195 kB 195 kB +119 B (+0.1%)
  • @firebase/firestore/exp

    Type Base (c6abcd8) Head (49b9efb) Diff
    browser 189 kB 189 kB +119 B (+0.1%)
    main 467 kB 467 kB +183 B (+0.0%)
    module 189 kB 189 kB +119 B (+0.1%)
    react-native 189 kB 189 kB +119 B (+0.1%)
  • @firebase/firestore/lite

    Type Base (c6abcd8) Head (49b9efb) Diff
    browser 64.5 kB 64.6 kB +119 B (+0.2%)
    main 141 kB 141 kB +183 B (+0.1%)
    module 64.5 kB 64.6 kB +119 B (+0.2%)
    react-native 64.6 kB 64.7 kB +119 B (+0.2%)
  • @firebase/firestore/memory

    Type Base (c6abcd8) Head (49b9efb) Diff
    browser 187 kB 187 kB +163 B (+0.1%)
    esm2017 146 kB 146 kB +119 B (+0.1%)
    main 348 kB 348 kB +183 B (+0.1%)
    module 185 kB 185 kB +163 B (+0.1%)
    react-native 146 kB 146 kB +119 B (+0.1%)
  • firebase

    Type Base (c6abcd8) Head (49b9efb) Diff
    firebase-app.js 20.0 kB 20.0 kB +1 B (+0.0%)
    firebase-firestore.js 287 kB 288 kB +165 B (+0.1%)
    firebase-firestore.memory.js 227 kB 227 kB +165 B (+0.1%)
    firebase-performance-standalone.es2017.js 72.1 kB 72.2 kB +1 B (+0.0%)
    firebase-performance-standalone.js 47.4 kB 47.4 kB +1 B (+0.0%)
    firebase.js 822 kB 823 kB +166 B (+0.0%)

Test Logs

@schmidt-sebastian schmidt-sebastian force-pushed the mrschmidt/parallelbuilds branch from 09a5a6a to 54fce67 Compare August 13, 2020 18:32
@schmidt-sebastian
Copy link
Contributor Author

The build doesn't seem faster on GA, but it is much faster for me locally. @samtstern - is it a lot of work to pull this into your branch that runs on GAE?

Copy link
Member

@Feiyang1 Feiyang1 left a comment

Choose a reason for hiding this comment

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

Nice. We can optimize the build process by only building the changed packages and their dependencies. I'm planning to work on it in the coming days.

@@ -36,7 +37,7 @@ const nodePlugins = [
target: 'es2017'
}
},
clean: true,
cacheDir: tmp.dirSync(),
Copy link
Member

Choose a reason for hiding this comment

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

Does it work? seems it creates a new dir every time, so the cache is not shared across builds.

Copy link
Contributor Author

@schmidt-sebastian schmidt-sebastian Aug 13, 2020

Choose a reason for hiding this comment

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

I believe we already didn't take advantage of cached build because we had to use "clean". IIRC, the build cache didn't work for us since we do not always use the same transformers, and the cache was not aware of what transformers were used to build it. If I leave "clean: true" but use the same cache dir, the builds fail as they clobber one directory.

@schmidt-sebastian schmidt-sebastian merged commit c5f3b27 into master Aug 14, 2020
@firebase firebase locked and limited conversation to collaborators Sep 14, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/parallelbuilds branch November 9, 2020 22:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants