Potential optimisation for LicenseCompareHelper.matchingStandardLicenseIdsWithinText()
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 28/100
- Tipo de issue
- Refactorización
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- java
- Área
- performance
Línea de trabajo
Empieza en src/main/java/org/spdx/utility/compare/LicenseCompareHelper.java, especialmente en matchingStandardLicenseIdsWithinText() y sus métodos relacionados. Primero comprueba si las coincidencias exponen índices del texto original y cómo se gestionan las plantillas superpuestas, como GPL-2.0-only y GPL-2.0-or-later. Se considerará completado cuando exista una estrategia definida de orden de coincidencia y eliminación de texto que preserve los resultados requeridos y el comportamiento de los índices, demostrando al mismo tiempo una mejora del rendimiento.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
It occurred to me that there may be a potentially substantial performance optimisation possible within the org.spdx.utility.compare.LicenseCompareHelper.matchingStandardLicenseIdsWithinText() family of methods, beyond the existing "quick check regex" optimisation.
Specifically, the idea is that when a match is found for a given license within an input text, the subset of text that matched is removed from the input text before further matching is performed. This not only speeds up subsequent matching (by reducing the size of the input), it also allows for early termination once the input is exhausted (i.e. below the size of the smallest possible match).
This enhancement could (should?) also order matching by approximate license popularity (i.e. the most popular licenses are checked first), since that would tend to result in early termination being reached more frequently in real world use. The OSI publishes such a list, albeit only for OSI-approved licenses - I'm fairly certain I've seen other sources of license popularity that would be more than enough for this purpose (after all it doesn't have to be precise - even using an approximate popularity order would be a lot better than random, or alphabetical, matching processing).
One possible complication is when two templates match the same text - for example the GPL-2.0-only and GPL-2.0-or-later templates tend to match the same thing. If this optimisation were implemented as I'm envisaging, whichever license template is used first would be the only one to show up in the result. Though if that behaviour is undesirable there may be workarounds - the library might maintain a list of "overlapping" templates, and ensure that when one of them matches a given text, the other overlapping templates are always checked too, prior to the matched text being removed from the input.
Another possible complication is if LicenseCompareHelper provides indexes into the original input text where a match was found (I don't recall if it does this or not; if it does I'm not currently using that capability). If so, there will be some extra bookkeeping needed to make sure that those indexes remain correct, given that each subsequent match attempt might only be looking at a fragmented subset of the original input.
- Lenguaje dominante
- Java
- Estrellas
- 71
- Forks
- 44
- Merge medio
- 16 h 17 min
- PR fusionados (30 d)
- 9
Preparar el entorno
- 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 spdx/Spdx-Java-Library
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
spdx/Spdx-Java-Library#449 ·
-
question
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
spdx/Spdx-Java-Library#398 ·
-
wontfix
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
spdx/Spdx-Java-Library#393 · 2 comentarios · 1 reacción ·
-
matching
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
spdx/Spdx-Java-Library#392 · 4 comentarios ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
spdx/Spdx-Java-Library#390 · 11 comentarios · 1 reacción ·
Todos los issues de spdx/Spdx-Java-Library
Issues similares
-
[destination-snowflake] Custom domains rejected unlike source connectionsPosiblemente ocupada @kuza55 la tomó hoy. Abiertoautoteam community connectors/destination/snowflake team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area-dashboard
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
component/operate kind/feature-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Forge coverage prompts carry text the agent cannot act onPosiblemente ocupada @graalvmbot la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
oracle/graalvm-reachability-metadata#10572 ·
Los mantenedores suelen responder en 1 día
-
Bundled migration plansAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
IBM/sample-app-mod#55 ·