Large content in a KM variable? (151k)?

I have a macro that runs a JXA script that stores 151k of stringified JSON data in a KM variable. Then I (at least I intend to) run a Custom HTML Prompt and retrieve that data in the HTML’s JavaScript. When the macro ends, I set (or will set, when I’m done testing) the variable to %Delete%. I suppose I could even set it to delete from the HTML JavaScript once I retrieve the data.

My question is, will this cause any unforeseen problems? I know KM variables can get stored in the environment, except when they’re large, and I’m sure this one would qualify as large. So I doubt that’s an issue. Any other issues?

Dan, I suppose that Peter is the only one who can provide an authoritative answer. But I would not expect any issues. I've seen macros discussed which read large files to process via a For Each loop.

You might just try a test macro, using all native KM Actions:

  • read a file the size of interest to a KM variable
  • do something to it
  • write to a new file

Time the execution, and, if it hasn't finished immediately, try working in some other app while it finishes.

Just an idea.

1 Like

It should be fine. The variables are all stored in a plist which is written when variables change, and, like with macros, if that plist gets large, performance will suffer. And they are held in memory as well.

But in those contexts, 150k is not large.

I would expect you’d have another couple orders of magnitude before you started noticing anything.

1 Like