Size-based representation for std::vector
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
- 30/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- cpp
- Área
- backend-api-design
Línea de trabajo
Empieza leyendo la propuesta de ABI de LLVM libc++ enlazada y el issue 2574 anterior de microsoft/STL; después, identifica las áreas de implementación y pruebas de STL afectadas por una representación alternativa de std::vector. Se considera terminado cuando el diseño propuesto basado en el tamaño esté implementado con una cobertura de ABI adecuada y su rendimiento y comportamiento se hayan validado para distintos tamaños de elemento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Instructions
libc++ has a new optional ABI where std::vector stores len and cap instead of pointers which yields significantly better results when hardening is enabled, and "positive or neutral impact on run-time" without hardening
Adding a size-based vector to libc++’s unstable ABI
tl;dr We can significantly improve the runtime performance of std::vector by changing its representation from three pointers to one pointer and two integers. This document explains the details of this change, along with the justifications for making it.
There was https://github.com/microsoft/STL/issues/2574 but the benchmarks there were flawed and not cover all cases like different element sizes. In real code there are a lot of cases where std::vector<some_struct> is used and the struct size is unlikely to be a power of 2. In this case size() would need a multiplication, usually by a small number that fit into the immediate field of the instructions, or can be split into LEA or SHIFT/ADD series. In the traditional pointer-based it's a division by some number that will be converted into multiplication by a large "random" number that may need multiple instructions to construct
It would be nice if this alternative layout can be added
- Lenguaje dominante
- C++
- Estrellas
- 11.2k
- Forks
- 1.7k
- Merge medio
- 4 d 4 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una 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 microsoft/STL
-
LWG
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 2 días
-
generator LWG
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
LWG
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
`<__msvc_math.hpp>`: `_USE_MATH_DEFINES` is ignored after the first `<math.h>` include under `/Zc:cmath`Posiblemente ocupada @tiagomacarios la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 2 días
Todos los issues de microsoft/STL
Issues similares
-
bug data-types
Dificultad 2/5 1-3 horas Aptitud para principiantes 71/100
ClickHouse/clickhouse-odbc#680 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
ionut-mihalache/aqua#31 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
needs-kind
Dificultad 2/5 1-3 horas Aptitud para principiantes 63/100
villagesql/villagesql-server#1702 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
microsoft/vcpkg-tool#2191 · 1 reacción ·
Los mantenedores suelen responder en 1 día