Server Side Actions With "any thing" Inputs - Do They Take a Double Performance Hit?

Hey Plugin Builders and @neerja

I’m building a plugin with a large server side action, which has around 10 input fields of type “any thing”. It runs super super slowly compared to what I had expected.

And then I started to wonder about whether each “any thing” input is taking a double hit on database access:

First time - when I call the plugin action, and reference a specific “thing” or do a search for a “list of things”.

Second time - when I perform all the properties.anything.get() functions to actually access the values from the database as the javascript code runs.

Is the database actually taking a double hit compared to accessing and processing the same data within a standard workflow, or is something in the way a server side action works optimising the process to prevent this?

Best wishes,
Antony.

Hi @antony, I think what you’re seeing is something I’ve run into in exploring server-side actions and building my first actions that accept things of any type and/or lists of any type.

There are very simple things you might think you can do (because they do return proper values), but that are not doing those things in a very efficient way. In particular, if you are (accidentally) depending upon automatic typecasting to get some value to resolve, that value resolution will be EXTREMELY slow.

And since there is basically NO documentation on any of this stuff, one is left to bump into it on one’s own. (To which I say, “GRUMBLE.”)

I’ve been working on a helper function that I’ll share when I’ve got it working entirely correctly.

Regards,
Keith

2 Likes