Lag when loading recursive data (experiment running Reducer on background thread)

Hey @mbrandonw and @stephencelis we are loving TCA! Great job, it has completely cleaned up our code.

We have however, run into performance issues when loading recursive data. The data structure is a nested collection of profiles linked to each other. There is a significant delay before the request to load the images is sent.

We tried to profile the app but are unable to understand what is going on. Running the Time Profiler in Instruments shows our scope operation taking the longest time.

When we run our Reducer on the background thread, this problem goes away. Using the background thread, the image is loaded before finishing navigation, versus the request starting 1 second after navigation using the main thread.

Could you please help shed some light on the issue? We have been struggling for a few weeks now and can’t seem to figure it out!
I have attached 2 stack traces, one running the Reducer on the main thread and the other in the background.

Any help is much appreciated.


The Stack Traces can be found in this Repository:

Please ignore the GitHub repo.. it seems the files are not readable, I will upload them again later.

Terms of Service

Privacy Policy

Cookie Policy