Skip to content

perf(build): record boot.pack from a start from a jar too, so it needs no app.pack - #84

Merged
Project516 merged 1 commit into
masterfrom
p516/boot-pack-jar
Nov 10, 2026
Merged

Project516 merged 1 commit into
masterfrom
p516/boot-pack-jar

Conversation

@Project516

Copy link
Copy Markdown
Owner

What this changes

boot.pack was recorded from programs run from a class folder only. A program started from a jar, by class name with a jar class path or with cheerpjRunJar, reads a few more java.base classes (java.util.jar.JarFile, URLClassPath$JarLoader and what they load). Those were in jdk/app.pack, so a page fetched all of app.pack on every cold start from a jar.

scripts/build-web.ts now also records Hello from a jar, both ways, into boot.pack. record() takes the launcher mode for that.

Sizes, gzip -6 as a host serves them:

master this PR
boot.pack 2.21 MB 2.42 MB
jdk/app.pack 1.44 MB 1.24 MB
Hello from a jar, cold 3.65 MB 2.42 MB
Hello from a class folder, cold 2.21 MB 2.42 MB
A program that needs app.pack anyway 3.65 MB 3.66 MB

Tests

  • In headless Chromium, with a log of every image read outside the packs: on master, Hello from a jar fetched jdk/app.pack on 6 of 6 cold loads (first miss URLClassPath$JarLoader.class) and with cheerpjRunJar on 3 of 3 (first miss JarFile.class); from a class folder it fetched only boot.pack. With this PR, all three ways fetch only boot.pack, 3 of 3 cold loads each, with no image read outside it.
  • pnpm typecheck passes.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 5bb2d91f-5a68-40ef-a576-cdf737bd70ec
Commits

Reviewing files that changed from the base of the PR and between ee2cf53 and 407273a.

Files selected for processing: 3

  • docs/browser.md
  • docs/development.md
  • scripts/build-web.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@project516-review-bot project516-review-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR extends boot.pack recording to cover program starts from a jar (both by class name with a jar classpath and via cheerpjRunJar/LM_JAR mode), not just from a class folder. This moves a few java.base classes (JarFile, URLClassPath$JarLoader) from app.pack into boot.pack, eliminating the extra app.pack fetch on cold starts from a jar. The build script now creates a hello.jar and records two additional runs; documentation is updated accordingly.


review-bot, model nvidia/nemotron-3-ultra-550b-a55b:free, verdict approve

@Project516
Project516 enabled auto-merge (squash) November 10, 2026 00:42
@Project516
Project516 merged commit b3de419 into master Nov 10, 2026
16 checks passed
@Project516
Project516 deleted the p516/boot-pack-jar branch November 10, 2026 00:51
@Project516 Project516 mentioned this pull request Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant