Uploaded image for project: 'CoreOS OCP'
  1. CoreOS OCP
  2. COS-2857

Optimize python execution time on ostree systems

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 0
    • 0

      Python compiles its source code into a file called a bytecode file. If the modification time (mtime) of the source file matches the mtime specified in the bytecode file, python knows that the source file has not changed and the bytecode file is reused (ie. a cache).

      On ostree based systems, the mtime of the python source files are set to zero whenever a new commit is deployed. Therefore, the mtime specified in the existing bytecode files do not match anymore and need to be recompiled, causing the slow runtime.

      The workaround solution is to set the mtime specified in the bytecode files to zero as well. The more sustainable solution is to use composefs in the future.

      https://gitlab.com/fedora/bootc/tracker/-/issues/3

              Unassigned Unassigned
              rh-ee-luyang Luke Yang (Inactive)
              Luke Yang (Inactive), Steven Presti
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: