No announcement yet.

When does compiling take place?

  • Filter
  • Time
  • Show
Clear All
new posts

  • When does compiling take place?

    I have searched, but seem to be unable to find an answer.

    When do .net scripts get compiled? Is it each and every time the script is executed? Or does Homeseer cache the compiled scripts so that later executions do not need a recompile?

    When the compile actually occurs needs to be considered as a design issue. If the script is recompiled each time it is used, then it will be better to make the script as small as possible, and to duplicate common subroutines/functions into each script that needs them. If just compiled once, then it would be better to make larger script files, with perhaps multiple entry points.

    Inquiring minds are curious.

  • #2
    My understanding (from way back in the HS1/2 says) was that they and asp/apsx files were compiled the first time they ran and were then cached. I don't know if that's documented anywhere, but I find that big asp/x pages definitely load faster the 2nd and subsequent times. With scripts, most of mine are so small that they run in less than a second and I've never bothered to check to see how long they actually run and whether subsequent runs are faster.
    HS 1990 Devices 1172 Events
    Z-Wave 126 Nodes on one Z-Net


    • #3
      Afaik the compiler is launched each time. It maintains a cache of already compiled scripts. File modification date used to trigger recompile. So transparent to HS which just tries to compile each time.


      • #4
        I have a Visual Basic script that defines a class. Within the class are defined some Shared variables. At first I though that every time the script is executed the shared variables would be uninitialized. But turns out that they retain their values across invocations of the script. So, I assume each script is only compiled the very first time it is executed.