nsg-ethz / p4-utils

Extension to Mininet that makes P4 networks easier to build
GNU General Public License v2.0
175 stars 65 forks source link

Frequent re-compiling #15

Closed vera closed 2 years ago

vera commented 3 years ago

I have noticed the following issues when using p4run:

  1. The P4 program is re-compiled every time p4run is executed, even when the file has not changed.
  2. When executing p4switch_reboot in the mininet console, the P4 program is always re-compiled on the first reboot, even when the file has not changed. On all following reboots, it is correctly not re-compiled.

I saw that you do attempt to limit re-compiling by checking if the files have been modified: https://github.com/nsg-ethz/p4-utils/blob/master/p4utils/mininetlib/cli.py#L128 However, this apparently only kicks in after the first re-compiling.

I think it would make p4run faster and more convenient to use if this could be improved.

edgar-costa commented 3 years ago

Hi Vera,

Yes you are right, this happens because when the program starts it does not have any "time" reference. I could maybe check the last modification of the .p4 and .json files. In theory that should work, unless I am missing something now.