achingbrain / achingbrain/uint8arraylist

Omit type-checking on append

未关闭
#58 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
TypeScript
星标
11
派生
9
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

调研方向

首先定位 TypeScript 的 append 实现和 append-all benchmark。检查 append 当前如何处理 Uint8ArrayList,以及有哪些公共 API 或测试覆盖它。完成的标准是:明确规定所提议的 append 行为以及任何单独的 join 或 merge API,并由 benchmark 确认预期的性能变化。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
backend-api-design, performance
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
32/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。