Coverage could point out writes that make method calls slower
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
- #1153 của @alantriesagain — đã đóng, không merge
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- developer-experience, tooling
Hướng nghiên cứu
Read the open pull request #1153 and the related issues #1148 and #963 first; the issue names no source files or tests. The request is for scriptc coverage to report writes that make method calls slower and support --fail-on=slow-paths, but it leaves diagnostic and CLI design choices open. Done would mean the report identifies affected methods, gives a hint, and CI can fail on those sites.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
scriptc coverage tells us whether a program compiles and where it may behave differently from Node. It does not say when a single line makes a large part of the program slower. In our case (#1148) one write made every method call go through a lookup on the object, and coverage still reported "fully static". The follow-up in #963 mentions the same blind spot: "static coverage was 100% on every broken build".
Take this program:
class Counter {
n = 0;
bump(): void {
this.n++;
}
}
function remember(cache: Record<string, unknown>, key: string, value: unknown): void {
cache[key] = value;
}
const counter = new Counter();
remember({}, "last", counter);
for (let i = 0; i < 1000; i++) counter.bump();
console.log(counter.n);
cache[key] = value could replace any method, so every call to bump is looked up on the object. That is correct, but nothing in the coverage report shows it. It would help to see these lines listed, with the methods they affect and a hint on how to avoid it, and to have a way to fail CI on them for projects that care about speed. We use something like this:
scriptc coverage report-demo.ts
statements analyzed 8
compile statically 8 (100%)
fully static — all analyzed statements compile to native code.
slower natively 1 site (compiles and behaves like Node; makes calls slower)
×1 SC7001 this write's key can name any property, so calls to method 'bump' dispatch dynamically: each call reads the method from the instance and boxes the receiver
at report-demo.ts:9:3
hint: type the key as a number or a string literal, write into an object created in this scope, or keep the entries in a Map
with scriptc coverage --fail-on=slow-paths in CI.
We built this for our own use and opened #1153 in case it is useful. It adds a new SC7xxx band of notes and a --fail-on value, which are design choices for you to make, so please treat the PR as a starting point, or close it, as you see fit.
- Ngôn ngữ chính
- TypeScript
- Star
- 6.7k
- Fork
- 229
- Merge trung bình
- 14 giờ 29 phút
- Pull request đã merge (30 ngày)
- 787
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của vercel-labs/scriptc
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
vercel-labs/scriptc#4865 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
vercel-labs/scriptc#4864 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows ARM64 as a cross-compile targetCó thể đã có người làm @hum-n đã nhận 1 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
vercel-labs/scriptc#4858 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
post-merge-bisect-unresolved
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 43/100
vercel-labs/scriptc#4791 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
post-merge-bisect-unconfirmed
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
vercel-labs/scriptc#4755 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của vercel-labs/scriptc
Issue tương tự
-
bug data-types
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
ClickHouse/clickhouse-js#1293 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area: middleware enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
agent/quality testing
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 1 ngày
-
GitHub registry install via `gh` credentials rewrites `\u0000`–`\u001f` escapes in source files to `^@`–`^_`Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 92/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
juspay/agent-distro#203 ·
Maintainer thường phản hồi trong vòng 1 ngày