Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

[QUAD] Enhancement: Multi-thread the convert_colorspace method #6307

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ccaillot
Copy link

No description provided.


pool = ThreadPool()
for chunk in chunks:
pool.apply_async(process_conversion, (input_path, output_path, chunk[0], chunk[-1]))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (96 > 79 characters)


# Collect channels to export
input_arg, channels_arg = get_oiio_input_and_channel_args(input_info)
def process_conversion(in_path, out_path, start_frame=None, end_frame=None):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

def get_chunks(frame_start, frame_end, chunk_size):
"""Chunk the frame numbers into groups."""
frames = list(range(frame_start, frame_end + 1))
chunk_list = [frames[i:i + chunk_size] for i in range(0, len(frames), chunk_size)]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (90 > 79 characters)

@ynbot ynbot added size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality labels Sep 11, 2024
@iLLiCiTiT
Copy link
Member

I'm not sure if multiprocessing does work (and is available) in all pythons, but this exact change can be done with just threading (which is in all pythons).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/S Denotes a PR changes 100-499 lines, ignoring general files type: enhancement Enhancements to existing functionality
Projects
Status: Pending Review
Development

Successfully merging this pull request may close these issues.

3 participants