Small string optimization (SSO)
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- c
- Área
- performance
Línea de trabajo
Start by reading quickjs.c, especially the JSString fields p->len and p->u.str8 and the JSValue representation described in the issue. Investigate whether small string optimization is worthwhile on 64-bit builds and feasible on 32-bit builds, including the stated access overhead. Done means providing evidence about the memory savings and tradeoffs on both build types.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Something to investigate: is SSO a worthwhile memory saving? My hunch says yes for 64 bits builds, no for 32 bits builds.
32 bits builds use NaN boxing. I don't think there's enough room left to store anything meaningful. On 64 bits systems:
-
a
JSValueis a 64 bits type tag + a 64 bits inline value or pointer -
There are only ~15 type tags at the moment; let's carve out space for 32 just in case
That leaves 64 + 64 - 5 = 123 bits or 15 bytes for storing strings inline, and there are several clever schemes for storing strings even longer than that.
Implementation caveats:
-
On little endian systems, the type tag is in the first byte, leaving the remaining 15 bytes as contiguous storage. Big endian systems are penalized because they have to perform a left or right shift whenever they access or store the type tag. Approximately no one uses BE systems anymore so probably not a huge concern.
-
quickjs.c directly accesses
JSStringfields all over the place;p->lenandp->u.str8in particular. Adding a layer of indirection introduces some overhead but hopefully that's offset by memory and refcount savings
- Lenguaje dominante
- C
- Estrellas
- 3.9k
- Forks
- 389
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 24
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 quickjs-ng/quickjs
-
Memory leak in JS_ReadBigInt when a bjson payload is truncated inside a BigIntPosiblemente ocupada @theaddonn la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
quickjs-ng/quickjs#1836 ·
Los mantenedores suelen responder en 2 días
-
Array.prototype.find frees an element twice when interrupted between iterationsPosiblemente ocupada @josefguenther la tomó hace 16 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
quickjs-ng/quickjs#1792 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Object.prototype.propertyIsEnumerable converts `this` before the property keyPosiblemente ocupada @SomSamantray la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
quickjs-ng/quickjs#1772 ·
Los mantenedores suelen responder en 2 días
-
Deserialization corrupts data or returns `undefined` when a RegExp precedes a shared object referencePosiblemente ocupada @Sree24-ui la tomó hace 15 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quickjs-ng/quickjs#1771 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
quickjs-ng/quickjs#1835 · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de quickjs-ng/quickjs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
GEODIFF_changesCount aborts the process on a truncated changeset (uncaught GeoDiffException)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MerginMaps/geodiff#272 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
open-quantum-safe/liboqs#2644 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
espressif/esp-adf-libs#89 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días