Alchemist listener listing

Porting my tools panel from CEP to UXP is well advanced.
With 267 functions to date, the js file as over 10K lines.
Looking at many posts, I saw that parts of the listener listings can be eliminated.
So, generally, which parts can be eliminated to get better efficiency.
Is there a link that could help?
All replies are welcome

What do you mean by “eliminated”?

these are some that I think are useless, but there may be others: modalStateChanged,toolModalStateChanged,backgroundSaveCompleted,homeScreenVisibilityChange,historyStateChanged

however from alchemist you can decide to exclude them

Maybe he meant the parts of the descriptor (or batchPlay call) that are redundant, at least if you’re using the default values. There’s also some whitespace and brackets you can get rid off if you want less lines of code. That doesn’t make the batchPlay call more efficient (in time) though.

For example

batchPlay([
   {
      "_obj": "make",
      "_target": {"_ref": "layer"},
   }
],{});

instead of

batchPlay(
[
   {
      "_obj": "make",
      "_target": [
         {
            "_ref": "layer"
         }
      ],
      "layerID": 2,
      "_isCommand": true,
      "_options": {
         "dialogOptions": "dontDisplay"
      }
   }
],{
   "synchronousExecution": false,
   "modalBehavior": "fail"
});

Sorry for the confusion, being french I interpreted the result of a listener as a list of the operations being executed.
The idea behind my question was that, if I suppress a lot of unneeded operations I would gain speed e.i. better performance. I have a function that will be around 2500 lines when finish.
Since it is not an important gain in performance, I will forget it.
So, thank you very much you for your support.

btw in Alchemist you can set default options for newly (if none item selected) created actions:

image

… and as a result
image

1 Like

Thank you so much, I didn’t know, it will certainly help.

You can remove the spaces and line breaks in batchplay to save space.

I am trying to save space, I want the best performance possible.
Thanks you, your comment is appreciate.