UpdateReferencedLayer executes very slowly?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
minigendo
Posts: 8
Joined: Sat Nov 22, 2008 4:01 pm

UpdateReferencedLayer executes very slowly?

Post by minigendo »

Greetings,

Seeking to customize the behavior of updating a layer reference (I wanted to keep the reference's name, rather than revert to the referenced Layer's, among other things), I came across the MohoLayer:UpdateReferencedLayer function (https://mohoscripting.com/methods/1117), which linked me to: http://mohoscripts.com/script/ss_ref_layer_update - a script which recreates the right menu click action, and which I might use as a base for modification.

In testing the script, however, I've noticed that it operates significantly more slowly than the right menu click action. Attempting to debug the issue, I've identified the function UpdateReferencedLayer as the bottleneck, and I've also determined that it's being called as many times as I'd expect it to. The slowdown seems proportional to the size of the referenced layer (A simple layer updates more quickly than a complex one. This behavior is also present in the right click functionality, but the magnitude is different.)

I wanted to inquire if this was a known issue, or if there was any known way to speed it up? I'm still running 12.5, if that makes a difference.

My thanks for your time, and apologies for the trouble.
Post Reply