question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, I know there are some issues open about the fetch being slow, but from what i see those issues are about when the app is in debugging mode(connected to the chrome), which is not the case.

The problem is, that when i make a request, it takes a lot of time to complete the request between point A and point B (see code), and this happen both in debug and release mode. We are talking about 2 mega of information that is coming from the server. in PostMan the same request take 3 second counted with a timer and 1155ms counted by PostMan.

//Point A
fetch('http://api.myApi.com/mobile/', {
  method: 'GET',
  headers: {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'Authorization': 'myToken'
  },
  body: null
}).then(res => {
  if (!res.ok) {
    throw Error(response.statusText);
  }
  //Point B
  return res.json();
})

Values in real devices from Point A to Point B: iPhone 6s: between 4 and 14 seconds iPhone6: between 25 and 40 seconds iPhone 5s: >1m

  • React Native version: V0.31.0
  • Platform: iOS, (Not 100% sure about Android, i just have one android device to test, so i can’t say if it is the device fault)
  • Operating System: MacOS
  • Network Info: Wi-fi, 200 mega optical fiber

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
SamiChabcommented, May 24, 2018

Nope, it doesn’t change a lot. But I guess the error was mine: I wasn’t calling exactly the same routes on iOS and Android… Thanks for your help @yury

0reactions
yurycommented, May 24, 2018

@SamiChab try set and see the difference

headers: {'Accept-Encoding':'gzip;q=1.0, compress;q=0.5'}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Fetch is Slow (60ms vs 3ms) - Stack Overflow
Running Javascript fetch takes about 60ms per call on ...
Read more >
Why I have fetch actions so slow when the service action ...
So, my guess is that on screen requests log, the duration is related with Network. Well yes,
Read more >
A trick to improve speed when you are interfacing with a slow ...
TLDR; I created a small npm package that acts as a wrapper around node-fetch, and returns the same promise for the same request, ......
Read more >
"Fetching older commits" is incredibly slow | Sourcetree ... - Jira
I've just set my "Log rows to fetch per load" to 0 and that seems to have done it for me. (I have...
Read more >
Slow package fetching | The FreeBSD Forums
Hello, I've trying to install some packages with pkg install, but the process is too slow today. How can I change the source?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found