Simulator slow to refresh

SOLUTION:

Looks like the issue was my connection. Changing HOST to LAN (from Tunnel) seems to have resolved the issue.


Hi:

I’m following a Udemy course which features the Expo XDE for React Native learning.

The tutor’s iOS simulator seems to refresh in quite a timely fashion, whereas locally, mine lags quite a bit. Here’s the log output for reference:


10:39:56 PM Restarting project and clearing packager cache (Hold shift while clicking restart to avoid clearing cache).
10:40:01 PM Starting React Native packager...
10:40:03 PM Scanning 646 folders for symlinks in /Users/[user]/[path]/node_modules (9ms)
10:40:03 PM Loading dependency graph.
10:40:03 PM Running packager on port 19001.
10:40:03 PM
10:40:05 PM Project opened! You can now use the "Send Link" or "Device" buttons to view your project.
10:40:05 PM Dependency graph loaded.

The device log output is as follows:

Running application "main"
with appParams: {
  "rootTag": 1,
  "initialProps": {
    "exp": {
      "manifest": {
        "packagerOpts": {
          "lanType": "ip",
          "strict": false,
          "minify": false,
          "urlRandomness": "gd-tj9",
          "hostType": "tunnel",
          "urlType": "exp",
          "dev": true
        },
        "slug": "swipe",
        "bundleUrl": "http://packager.gd-tj9.nextriot.swipe.exp.direct:80/main.bundle?platform=ios&dev=true&strict=false&minify=false&hot=false&assetPlugin=expo/tools/hashAssetFiles",
        "debuggerHost": "packager.gd-tj9.nextriot.swipe.exp.direct:80",
        "loading": {
          "iconUrl": "http://packager.gd-tj9.nextriot.swipe.exp.direct:80/assets/./assets/icons/loading.png",
          "icon": "./assets/icons/loading.png",
          "hideExponentText": false
        },
        "icon": "./assets/icons/app.png",
        "primaryColor": "#cccccc",
        "isVerified": true,
        "name": "swipe",
        "version": "1.0.0",
        "xde": true,
        "iconUrl": "http://packager.gd-tj9.nextriot.swipe.exp.direct:80/assets/./assets/icons/app.png",
        "id": "@nextriot/swipe",
        "orientation": "portrait",
        "sdkVersion": "16.0.0",
        "ios": {
          "supportsTablet": true
        },
        "logUrl": "http://gd-tj9.nextriot.swipe.exp.direct:80/logs",
        "env": {},
        "privacy": "public",
        "mainModuleName": "main",
        "developer": {
          "tool": "xde"
        },
        "description": "An empty new project"
      },
      "appOwnership": "expo",
      "initialUri": "exp://localhost:19000",
      "shell": false
    }
  }
}.__DEV__ === true, development - level warning are ON, performance optimizations are OFF

Any ideas as to why their machine would be almost instantaneous whereas mine takes ~9s? If so, any ideas on how to resolve the lag?

I’m using a 2.7Ghz MBP w/ Touch Bar (2016).

Thanks in advance.

1 Like

Having similar issues. Feeling 3 - 5 seconds longer lag to reload when using expo xde compared to react-native-scripts.

same issue here, it takes about 3-4 seconds to reload / live-reload

The tunnel is sometimes slow – you can change the development url to LAN or localhost (if your environment permits) – live reload should be faster in that case.

1 Like

Seems to be exactly the same for all 3. Compared to vanilla react-native, its almost 50% slower - if not more :cry:

Is this on iOS or Android?

iOS, using iPhone 6 simulator, tested on new blank expo project, compared it to create-react-native-app

my computer specs

although i’ve tested it on my work computer as well

create-react-native-app actually uses the same internals as exp and XDE, so it’s interesting that you’d see different performance characteristics between the two projects.

If you get some time, it would be awesome if you could throw a repo up on Github with copies of both of the projects, as well as reproduction instructions.

Will try get this done today, along with some time metrics.

Thanks for your time.

https://github.com/farzd/expoSpeedTest
I created an issue on github before i commented here, would it be suitable to move the discussion there?

EDIT: Restarting the IDE did the trick, restart button was making no difference for me !?

Thanks

1 Like

@nextriot can you please give a bit more information on how you changed the setting from tunnel to lan? If I understand correctly, the change has to be done in the app.json file but can’t figure out exactly what I need to do.

Thanks!

Hi @polp6880.

You make the change directly in the Expo XDE. Here’s a screenshot:

Let me know if I can help further.

6 Likes

That did the trick @nextriot - many many thanks :slight_smile:

2 Likes

Changing Host from Tunnel to LAN did the Trick for me too

Keep the devmode on.

Press Command+D (Ctrl+M on windows).
Disable the LiveReload feature.

Do it again.
Enable the HotReload feature.

Expo will re-render the component which was modified, not generate the whole bundle again.

Cheers and happy hacking.

Hot reloading do helps do see small changes like text change and stuff but is no helpful while debugging Animation.
You have to go old way of Live reload for Animation debugging which is too slow to reload compared to Vanilla React Native. Even changing host to lan (from tunnel) is not working for me. Expo with all those great features is killing the fast reload time which made me love react native. I don’t know if its happening only for me or for everyone else.

that worked for me. much faster ! thank you…

I was facing 2mins of wait from app refresh to the app fully initialized.

Another option that worked for me is in the ios simulator menu… go to hardware and select erase all content and settings and refresh the app.

Sometimes i’m facing stuck in 100.00% when I change it to LAN. How do I solve stuckin in 100.00%?

Me too. If only I bring up debugger in chrome, I always stuck in 100.00% even I change it to LAN.