perf(quickjs): 关闭函数源码保留以节省运行时内存
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- performance
Research direction
Start from the pinned QuickJS header linked in the issue, around JS_SetStripInfo and JS_STRIP_SOURCE (lines 936-939 of quickjs.h). The payload does not name where pocketjs creates its runtime, so find that call site first. Verify that the flag is set only for release builds, and check whether QuickJS-NG supports it, as the issue asks. Done means the release runtime sets the flag, and error stack line numbers still appear.
Written by the indexing model from the issue text.
Description
仓库固定版本的 Bellard QuickJS 支持在编译应用前调用:
JS_SetStripInfo(runtime, JS_STRIP_SOURCE);
这可以关闭函数源码副本的保留,减少运行时内存占用,同时保留字节码和错误堆栈的文件、行号信息。可考虑在发布运行时采用。
可见行为变化是 Function.prototype.toString() 不再返回原函数源码。此开关不移除包内用于编译执行的 app.js;QuickJS-NG 的支持需另行核对。
参考:固定版本 QuickJS API。
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 88
- PR merge metrics
- No merged PRs in 30d
Getting set up
We have not checked this project's setup files yet. Start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pocket-stack/pocketjs
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
pocket-stack/pocketjs#729 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pocket-stack/pocketjs#725 ·
-
enhancement
Difficulty 1/5 Under an hour Newbie friendliness 85/100
pocket-stack/pocketjs#724 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 62/100
pocket-stack/pocketjs#728 ·
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
pocket-stack/pocketjs#727 ·
All issues in pocket-stack/pocketjs
Similar issues
-
dream report: normalizeMutation discards ok/status, consumers can only string-match the summaryOpen
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
thecodacus/understory#61 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Termix-SSH/Plugin-Hosts-Config#14 · 1 comment ·
Maintainers usually reply within 4 days
-
ai-generated priority: p2 size: s type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JonathanTSilva/jts-website#92 ·
Maintainers usually reply within 1 day
-
Toast announcer reads a doubled period when a toast's title ends in punctuationPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel-labs/ui#999 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
ehmpathy/rhachet-roles-ehmpathy#1443 ·
Maintainers usually reply within 1 day