achingbrain / achingbrain/uint8arraylist
Omit type-checking on append
- Vorherrschende Sprache
- TypeScript
- Sterne
- 11
- Forks
- 9
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Currently on append "instanceof Uint8array" is called on every element, which does have an effect on the performance. It would be ideal instead that append method would only accept Uint8array and utilize Typescript types to make sure we are not appending things of wrong type.
For the case where we want to append UInt8ArrayList, we could have a separate method like, `join` or `merge` to cover that specific case.
For the append-all benchmark I can get 5.9m ops/s without type checking
and 5.5m ops/s with type checking
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die TypeScript-Implementierung von append und den append-all-Benchmark zu finden. Prüfe, wie append derzeit mit Uint8ArrayList umgeht und welche öffentliche API oder Tests dies abdecken. Erledigt ist die Aufgabe, wenn das vorgeschlagene Verhalten von append sowie eine separate join- oder merge-API klar definiert sind und der Benchmark die beabsichtigte Performance-Änderung bestätigt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- backend-api-design, performance
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 32/100