Click here to Skip to main content
15,796,456 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I'm currently developing a crypto trading mobile application using React Native where I've integrated the free Binance WebSocket to fetch real-time market data. However, I'm encountering severe performance issues due to React Native being single-threaded.

When receiving data from the WebSocket on the main thread, the app's performance significantly degrades. For instance, after clicking on a button, the app takes an excessive 30 to 40 seconds to respond.

I'm seeking guidance on potential solutions or best practices to mitigate this performance bottleneck. Is there a way to efficiently handle real-time WebSocket data in React Native without affecting the app's responsiveness? Are there any threading strategies or optimizations that can be implemented to improve the app's performance while receiving real-time market data from Binance WebSocket?

Any insights, code snippets, or recommended libraries that could assist in optimizing the handling of real-time data within a React Native application would be greatly appreciated.

What I have tried:

I have tried to several method but failed to improve performance
Posted
Updated yesterday
Comments
Andre Oosthuizen yesterday    
It will assist if you show us some of those "several method but failed to improve performance" ones you have tried. There is no real information here to even start trying to help you.
Gerry Schmitz 10hrs 5mins ago    
What's the smallest unit of work? One retrieves only what one needs for a given "frame". I've fetched real-time data, but I put in a (concurrent) queue that others "subscribe" to and can consume at their own rate. That supports 2+ threads.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900