richrobber2 / canvas-zoom

zoom and pan functionality
350 stars 23 forks source link

performance hit #77

Closed richrobber2 closed 1 year ago

richrobber2 commented 1 year ago

it seems you are using trigger_on_changetoo much since it is also calling get_image_data which has multiple canvas and thats a lot of data to have run

the function saveLine which is run on every line draw also runs the trigger_on_change

the main mouse up function also has the trigger_on_change as well so it seems a lot is being done all at once

main thing to get from this is i think you/we need to look into this

image

richrobber2 commented 1 year ago

at least i think it was you in the svelte files

daswer123 commented 1 year ago

Hi, I didn't touch this behavior and it's default. To be honest, even though I modified the gradio a little bit for the extension, but I myself do not fully understand everything, such things I prefer not to touch because I can not fully predict the possible consequences. https://github.com/gradio-app/gradio/blob/main/js/image/src/Sketch.svelte