Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[experiment] force chunking when using dynamic sources

Abierto
#909 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
12/100
Tipo de issue
Refactorización
Claridad
Necesita aclaración
Estado de actividad
Tranquilo
Stack tecnológico
rust

Línea de trabajo

The payload names no files, only the mixer's Box<dyn Source> storage and a sketched Chunked wrapper with a next method on Mixer. Start by finding where the mixer boxes its sources and how next() pulls samples, then benchmark the current path. Done would mean a measured comparison with a proposed design agreed in the thread, which is not yet settled.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement

I suspect one thing that can really slow the mixer down is that it takes Box<dyn Source>. Since the next() calls cannot be inlined here this probably slows everything down. We can make this less of an issue by getting chunks (up to some size) in the mixer. Roughly:

impl source -> Sample
chunked(impl source) -> [Sample]    // returns array
Box<dyn chunked> -> [Sample]        // return array
Mixer() -> Sample (uses the chunks internally)

Now the only way to get a nice API with this is to hide the whole chunking inside the mixer. Like this:

struct Mixer {...}

impl Mixer {
    fn add(&mut self, s: impl Source) {
        let chunked = Chunked::from(s);
        let chunked = Box::new(chunked) as Box<dyn Chunk>;
        self.sources.push(chunked)
    }
    ...
}

impl Iterator for Mixer {
    fn next(&mut self) -> Option<Sample> {
        if self.cached_chunks.is_empty() {
             for chunked in self.sources {
                  self.cached_chunks.push(chunked.next_chunk())?;
             }
        }
        
        let mut sample = 0.0;
        for chunk in &mut self.cached_chunks {
            sample += chunk.pop_front();
        }
        Some(sample)
    }
}

Lenguaje dominante
Rust
Estrellas
2.5k
Forks
338
Merge medio
1 d 3 h
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de RustAudio/rodio

Todos los issues de RustAudio/rodio

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.