achingbrain / achingbrain/uint8arraylist
Omit type-checking on append
- Dominant language
- TypeScript
- Stars
- 11
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the TypeScript append implementation and the append-all benchmark. Check how append currently handles Uint8ArrayList and what public API or tests cover it. Done means the proposed append behavior and any separate join or merge API are clearly defined, with the benchmark confirming the intended performance change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100