#Performance issues using Rayon

22 messages · Page 1 of 1 (latest)

velvet pelican
#

Hi everyone, i'm new here and i need help working on a Tauri project
Basically it's a bot that check you HP to see if you need to eat, and search for monsters, attack them and use skills all of this using pixel detection
Works very fast on my current version.
The main project is here : https://github.com/MadrigalStreetCartel/neuz
I want to refactor it so we can start multiple instances of the game client at once
The issue is that now i have made almost the biggests part i saw that image processing tooks a lot of time compared to my current project, and even more when running multiple instances each instances use a spawned thread to play his routine and pixels iterating is made using par_bridge
To make it simple using 1 instance i approx 200ms to match pixels using two instances it tooks +500ms/instance
Do you guys have an idea i can share private repo if you send your ID, evertything will be open source at the end

sturdy timber
#

if it's not enough work then par_bridge will just dispatch each pixel as a task

#

and the threading overhead will overwhelm the processing

velvet pelican
#

It compare pixel colors to a list of references

velvet pelican
sturdy timber
#

what does "one instance" mean?

#

how does number of instances relate to rayon threads?

velvet pelican
#

Basically I have a main window that open multiple clients when I have only one client everything is ok

#

But many clients makes it slow

#

I can share the whole project via github if needed to understand

sturdy timber
#

that declares commitment, so I don't want that :P

#

the only thing that comes to mind with that description is synchronization between clients

velvet pelican
#

They are not synchronized

sturdy timber
#

and how you're spawning the rayon tasks

velvet pelican
#

Something like that

#

Clients are started using std thread spawn

sturdy timber
#

yeah I don't see anything here

velvet pelican
#

Arf i can’t send more im not home rn I can only share the github repo

turbid verge
velvet pelican
#

I’ve added filter thought it was better but didn’t change that much do you think is due to the fact rayon has already too much threads so it’s slow ?