单二进制改用预编译字节码(--bytecode --format=esm)。SQL 判题每题都要起一次子进程, 单核实测从约 120ms 降到约 72ms;serve 起服务约 180ms → 100ms,内存不变,二进制大 8MB。 编译形态在仓库外实跑过:migrate / healthcheck / serve / worker 能起,C 题判对、 AST 规则判出 10、jieba 分词、SQL 子进程的判题与展示都和 dev 形态结果一致。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eb0309ae35
commit
b3dca1a271
2 files changed
+5
-1
No files matched your search
@@ -9,7 +9,7 @@
|
||||
"dev:worker": "bun --watch src/main.ts worker",
|
||||
"start": "bun src/main.ts serve",
|
||||
"worker": "bun src/main.ts worker",
|
||||
"build": "bun build --compile --target=bun-linux-x64 src/main.ts --outfile ../../dist/oj2-api",
|
||||
"build": "bun build --compile --bytecode --format=esm --target=bun-linux-x64 src/main.ts --outfile ../../dist/oj2-api",
|
||||
"seed:dev": "bun src/scripts/seed-dev.ts",
|
||||
"recount": "bun --env-file=../../.env src/main.ts recount",
|
||||
"rediagnose": "bun --env-file=../../.env src/main.ts rediagnose",
|
||||
|
||||
Reference in new issue
Block a user