mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Improves transcoding performance and memory usage
Configures OpenImageIO (OIIO) to use a percentage of available memory as a cache. This improves transcoding performance by reducing disk I/O. Also, this change adds the 'psutil' package as a dependency to gather system memory information. It also enables multithreading in OIIO to further enhance performance.
This commit is contained in:
parent
fcd6bfdf0f
commit
608ad092e5
2 changed files with 10 additions and 1 deletions
|
|
@ -6,6 +6,7 @@ import collections
|
|||
import tempfile
|
||||
import subprocess
|
||||
import platform
|
||||
import psutil
|
||||
from typing import Optional
|
||||
|
||||
import xml.etree.ElementTree
|
||||
|
|
@ -1009,12 +1010,19 @@ def convert_colorspace(
|
|||
# Collect channels to export
|
||||
input_arg, channels_arg = get_oiio_input_and_channel_args(input_info)
|
||||
|
||||
# Prepare subprocess arguments
|
||||
# Use 50% of available memory for cache (in bytes)
|
||||
available_memory = psutil.virtual_memory().available
|
||||
cache_size = int(available_memory * 0.5)
|
||||
|
||||
# Prepare subprocess arguments
|
||||
oiio_cmd = get_oiio_tool_args(
|
||||
"oiiotool",
|
||||
# Don't add any additional attributes
|
||||
"--nosoftwareattrib",
|
||||
"--colorconfig", config_path
|
||||
"--threads", str(os.cpu_count()),
|
||||
"--cache", str(cache_size),
|
||||
"--colorconfig", config_path,
|
||||
)
|
||||
|
||||
oiio_cmd.extend([
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ jsonschema = "^2.6.0"
|
|||
pyblish-base = "^1.8.11"
|
||||
speedcopy = "^2.1"
|
||||
six = "^1.15"
|
||||
psutil = "^5.9.0"
|
||||
qtawesome = "0.7.3"
|
||||
|
||||
[ayon.runtimeDependencies]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue