Currently library reads data, parses XML and processes stanza using single thread.
I think it is worth to look into this and allow reading data, processing, etc. to be done in many threads. This can speed up time needed for connection/resumption and it may also reduce energy usage due to shorter processing time.
Artur Hefczyc commented 8 years ago
+1, I think this is essential for version 1.0.
Andrzej Wójcik (Tigase) commented 8 years ago
I added additional processing queues in TigaseSwift library which should offload processing from main application thread. I also changed queues used for firing events and callbacks passed as parameter to function.
Due to this changes it was required to change few methods and adjust mobile application to work properly with multiple threads - now it receives event not on main thread, so proper "synchronization" was required (in fact there is no synchronization in Swift, so I needed to properly use dispatch queues).
During my initial test I found few issues and fixed them. I adjusted due date to have time to verify my changes before pushing them to master branch.
I also run profiler on library and client and identified few issue - for them I will create separate tasks.
Currently library reads data, parses XML and processes stanza using single thread.
I think it is worth to look into this and allow reading data, processing, etc. to be done in many threads. This can speed up time needed for connection/resumption and it may also reduce energy usage due to shorter processing time.