Performance improvement in `SimHashIterator`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- rust
- Área
- performance
Línea de trabajo
Comienza localizando SimHashIterator, BitChunks y SIM_BUCKET_SIZE en el repositorio; después, lee cómo se forman actualmente los buckets. Investiga cómo BitChunks puede omitir rangos de ceros y cómo se manejaría un bucket que abarque varios chunks. Se considera terminado cuando se reduzca la mezcla de rangos vacíos sin cambiar los resultados de los buckets de SimHash.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The current SimHashIterator works by finding the most significant active bit, and then calculating the number of SimHash buckets that will exist from that bit to the end of the filter. This means we are iterating (most_significant_bit / SIM_BUCKET_SIZE) + SIM_BUCKETS buckets.
The problem here is that in the higher order bits the sparsity is very high, meaning that there will potentially be many buckets where the values we're mixing into our SimHashes will just be zeros, and given any value XOR 0 is just that value this is wasted computation.
We could move to use the BitChunks iterators which batch up our chunks into a u64 and an index of that block of bits, skipping ranges full of zeros. This will introduce issues where if our SimHash bucket straddles multiple BitChunks, which can be solved by peeking the next chunk, making sure that the index is contiguous with our current chunk.
Right now SIM_BUCKET_SIZE is always 6 bits but if we allowed fully arbitrary SimHash bucket sizes this could get slightly gnarly because we'd need to be able to peek an arbitrary number of BitChunks ahead of the current position.
The following is a line chart plot of the proportion of empty bit_ranges mixed into the SimHashes using pseudorandomly generated geofilters with 0..100_000 items added to them.
The ratio reduces very sharply after a couple of inserts but remains relatively high since newly added items have some chance of landing in a very significant bucket which introduces a load of zero gaps before the next one bit.
- Lenguaje dominante
- Rust
- Estrellas
- 134
- Forks
- 23
- Merge medio
- 14 h 37 min
- PR fusionados (30 d)
- 8
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de github/rust-gems
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
github/rust-gems#159 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
github/rust-gems#82 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
`bpe` Python Bindings?Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
github/rust-gems#61 · 1 comentario · 2 reacciones ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
github/rust-gems#51 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de github/rust-gems
Issues similares
-
area:release bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
registrystack/registry-stack#1874 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
component:midnight-toolkit status:untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
midnightntwrk/midnight-node#2237 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día