Hello Anvil Community,
I am currently facing a performance challenge in my app and would appreciate any insights or suggestions you might have.
The Process: My application involves a significant amount of image processing, which is central to its functionality. The process is as follows:
- JavaScript in a component calls a function (
getFrame
) on the client side of Anvil. -
getFrame
then calls a function on the server side of Anvil. - The server side function communicates with our uplink.
- The uplink loads an image and sends it back to the server.
- The server then sends the image back to the client.
- Finally, the client passes the image back to the original JavaScript.
This process is summarized as: JavaScript (JS) -> Client Code -> Server Code -> Uplink -> Server Code -> Client Code -> JS
.
Performance Issue: The critical issue I’m encountering is with the transfer times between different stages, specifically:
- The transfer from the uplink back to the server takes about 1 second.
- However, the transfer from the server back to the client is notably slower, taking approximately 1.7 seconds.
Given the nature of our application, optimizing this image loading process is crucial.
Attempts at Optimization:
- I have explored standard optimization techniques, but the unique structure of the process and the role of the uplink seem to limit my options.
- Direct communication between the client and the uplink is not possible, as per Anvil’s architecture.
I am seeking advice or insights on how to optimize this process, especially in reducing the time taken for the image to transfer from the server back to the client.
Thank you in advance for your assistance!