Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Implement the data collection logic through a saperate couroutine/optimise it #17

Open
shashankRanaNW opened this issue Jan 30, 2023 · 0 comments

Comments

@shashankRanaNW
Copy link
Contributor

Currently the data collection logic is running on Dispatchers.Main

As it runs every 13ms, it is in interest of efficiency that we make it quicker. Got to look in if we spawn a coroutine of the same Dispatcher in a given coroutine, whether they run separate threads or they run parallelly.
The data collection should be done in an separate coroutine.

Any improvement in this regard would bring down the data collection interval.

Possibly we can see the time taken by different operations and keep only less processor intensive processes in the while(true) loop, and keep processor intensive processes in another coroutine, running continuously. Perhaps can mutableList and replace it with ArrayList, or keep it in an temp var and append it in another coroutine?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant