Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

CodePoints.uncons performance optimization?

Aperta
#154 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
performance

Direzione di ricerca

Start with Data.String.CodePoints.uncons in src/Data/String/CodePoints.purs and the related helper in src/Data/String/Unsafe.js, then compare the referenced Data/Enum.js implementation. Confirm that the intermediate charAt slice can be avoided by using charCodeAt directly, while preserving uncons behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: enhancement

It seems to me that these lines in Data.String.CodePoints.uncons

https://github.com/purescript/purescript-strings/blob/157e372a23e4becd594d7e7bff6f372a6f63dd82/src/Data/String/CodePoints.purs#L197-L198

are first slicing the first code unit into a Char string with the JavaScript charAt method

https://github.com/purescript/purescript-strings/blob/157e372a23e4becd594d7e7bff6f372a6f63dd82/src/Data/String/Unsafe.js#L5

and then converting the Char string to a CodePoint by the boundedEnumChar instance fromEnum method which calls the Javascript charCodeAt method.

https://github.com/purescript/purescript-enums/blob/170d959644eb99e0025f4ab2e38f5f132fd85fa4/src/Data/Enum.js#L4

We could skip the intermediate string slice of the charAt method and call charCodeAt directly.

Lingua principale
PureScript
Stelle
57
Fork
76
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di purescript/purescript-strings

Tutte le issue di purescript/purescript-strings

Issue simili

Altre issue su Performance

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.