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

Performance Issue #113

Closed
GautierT opened this issue Sep 8, 2021 · 1 comment
Closed

Performance Issue #113

GautierT opened this issue Sep 8, 2021 · 1 comment

Comments

@GautierT
Copy link

GautierT commented Sep 8, 2021

Description of the bug

It took a long time to publish a new version from the starting of the metro bundler to the complete bundle. (8 minutes)

To Reproduce

What steps did you perform which led to this issue?

Use this workflow

name: Expo Publish Prod
on:
  push:
    branches:
      - main
jobs:
  publish:
    name: Install and publish
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 14.x
      - uses: expo/expo-github-action@v6
        with:
          expo-version: 4.x
          expo-cache: true
          token: ${{ secrets.EXPO_TOKEN }}
      - run: npm install
      - run: APP_ENV=production expo publish --release-channel prod

Expected behavior

It's very fast on local (max 1 minutes)

Actual behavior

It take 8 minutes on github actions

Additional context

The cache is activated with the expo-cache option

LOGS :

APP_ENV=production expo publish --release-channel prod

[10:14:02] › Expo SDK: 41.0.0
[10:14:02] › Release channel: prod
[10:14:02] › Workflow: Managed

[10:14:02] Building optimized bundles and generating sourcemaps...
[10:14:04] Starting Metro Bundler
[10:22:10] iOS Bundling complete 486190ms
[10:22:10]
[10:22:10] Bundle Size
┌ index.ios.js 5.47 MB
├ index.android.js 5.49 MB
├ index.ios.js.map 14.6 MB
└ index.android.js.map 14.7 MB
[10:22:10]

@byCedric
Copy link
Member

Hi @GautierT! Thanks for the issue report. But, this is somewhat expected, here is why:

  • expo-cache is only caching the expo-cli installation, it does not cache your project.
    This allows you to skip installing expo-cli every time you need it, saving ±1-2m every run.
  • Github Action runners aren't the fastest machines out there.
    Your local machine is much more powerful compared to the machine that Github Actions is running. Publishing or building locally is always faster compared to GH actions, unfortunately.

One thing you could do is caching the Metro cache. It does have some implications if you use things like babel-plugin-inline-dotenv (or similar plugins). If you want to speed it up, please test this before pushing it to production.

Hope this helps!

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

No branches or pull requests

2 participants