Fetch is Slow
See original GitHub issueHi, 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:
- Created 7 years ago
- Reactions:1
- Comments:7
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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
@SamiChab try set and see the difference