Author Topic: Excute another command...  (Read 2107 times)

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Excute another command...
« on: September 11, 2019, 12:05:03 PM »
So a couple of nights ago I "carelessly" branched-out 3 Execute Another Command from one, to a second and to a third command. I say "carelessly" because it was not planned.  I was at the second command and decided to branch to a third without realizing I was already at the second command.

Now, it seems to work just fine.  No issues through about 8 hours of playing ED.  But I just wanted to make sure it wasn't a fluke that it's working.  Is it OK to branch through more than one other command concurrently (of course waiting for the third to finish before returning to the second and then back to the first)?

On a related note: if it is OK to branch more than one concurrently, how many (within reason) can you string together?

Hope that makes sense.   :P

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: Excute another command...
« Reply #1 on: September 11, 2019, 12:27:02 PM »
Yes, that is a perfectly normal use of the "Execute Another Command" action.

There is no artificial limit as to how many commands you can execute within the same chain, that I know of.
At some point you'll run out of memory (as each command in the chain would stay in memory until those executed by it return), but as commands are not intended to be executed recursively, that's unlikely to happen (as you'd have to create a unique command for each link of the chain).

Do note that executing another command like this is slightly slower than executing the actions directly within the same command, as the next command in the chain must be looked up, loaded into memory, and any command-specific options (E.G. the target) set up.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: Excute another command...
« Reply #2 on: September 11, 2019, 02:52:06 PM »
Yes, that is a perfectly normal use of the "Execute Another Command" action.

There is no artificial limit as to how many commands you can execute within the same chain, that I know of.
At some point you'll run out of memory (as each command in the chain would stay in memory until those executed by it return), but as commands are not intended to be executed recursively, that's unlikely to happen (as you'd have to create a unique command for each link of the chain).

Do note that executing another command like this is slightly slower than executing the actions directly within the same command, as the next command in the chain must be looked up, loaded into memory, and any command-specific options (E.G. the target) set up.

22 minutes to answer...I'm slightly disappointed.   :P

Not sure how much of delay will be "felt" in the age of 64gb of RAM, SSD's and 8 core 5ghz processors, but point noted.

Thanx for the clarification.

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4761
  • RTFM
Re: Excute another command...
« Reply #3 on: September 11, 2019, 03:15:33 PM »
Not sure how much of delay will be "felt" in the age of 64gb of RAM, SSD's and 8 core 5ghz processors

On my machine, decrementing an integer value 10 times and checking its value each iteration of a loop takes about 100ms, doing it using multiple commands in a chain (where each command in the chain decrements by one) takes about 140ms (and this delay appears to scale linearly: If you do it 100 times it's about 1 second vs 1.4 seconds), so if you're dealing with time-sensitive commands it can matter.

Admittedly, my machine doesn't nearly meet those specifications, but it's not a 486 either.