Feature request: `Async` codec

Open
#123 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data, performance

Research direction

Start by reviewing the TranscodingStreams codec interface and the existing decompression and compression codec behavior. Define how an Async wrapper would coordinate its input, internal buffer, and output while ensuring transcoding runs in another task. Done means the proposed codec works with arbitrary TranscodingStreams codecs and preserves the expected stream behavior.

Written by the indexing model from the issue text.

Description

As far as I can tell, TranscodingSteams (TS) is currently mostly used for de/compression codecs, which are quite CPU-intensive. In this case it would be beneficial to allow the de/compression to happen in a separate thread concurrently.

I think this can be solved by having an Async codec that wraps any TS, such that the underlying stream's transcoding happens in another thread. More specifically, Async could carry an internal buffer B along with its input (I) and output (O) buffers. When O runs dry, it will copy data from B to O, then schedule the transcoding from I to B.

I believe this codec should be in TS and not a separate package because:

  1. It's near-universally useful for users of TS
  2. The Async codec might have to reach into TS's internals for efficiency, to make sure the underlying TS really does run its transcoding in a different task.
Dominant language
Julia
Stars
90
Forks
26
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaIO/TranscodingStreams.jl

All issues in JuliaIO/TranscodingStreams.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.