Commit 8e9cc2b
perf: finish the optimization batch — pipeline, network, diff and startup
hermes-base
- a bundleHash mismatch of the entry read over Range is final
(BundleHashMismatchError): no fallback to the whole archive, no retry;
the server lookup is retried once, downloads only on transport errors
- cache hits for records without a bytecodeVersion (legacy / native
package) verify the HBC header; cacheLookup hashes the file streamed
- downloads get a 30 s headers timeout and a 60 s idle timeout; stale
cachePut staging files (<hash>.<pid>.tmp) are evicted and cleaned
bundle-runner / bundle
- hermes-base-error.log is written next to the intermediate dir instead
of inside it (it was packed into the ppk)
- the base selection starts after Metro is spawned; its synchronous head
(hermesc lookup, HBC probe) no longer delays Metro
- the JS bundle is renamed into a work dir and both hermesc runs read it
there (no copies); the packager map is renamed, not copied
- compose-source-maps runs asynchronously and speculatively during the
disassembly compare, redone from the plain map if the base is rejected
- one compilePlain helper (runProcess) replaces three spawnSync sites;
the base attempt passes -w and its stderr is bounded (512 KB head+tail)
- a failed plain compile is reported as such (hermesBasePlainCompileFailed)
and keeps the base instead of dropping it and compiling a third time
- the compile phase waits at most 60 s (PUSHY_HERMES_BASE_WAIT_MS) for a
base still being fetched, then compiles plain
- new --resetCache option (default true); false reuses Metro's cache
diff / hbcTransform
- moved-file matching keys on crc32 + uncompressed size (a colliding
crc could ship the wrong file); manifest format unchanged
- a failing diff destroys the output stream and removes the partial patch
- the streaming diff transforms HBC on disk section by section
(transformHbcFile); no full bundle copy is held in memory any more
zip-range / zip-entries
- chunk cache merges only on strict overlap, single-chunk entries are
returned as views (entry memory 3x -> 1x); hinted reads no longer
re-fetch cached bytes or widen tiny entries to 64 KB
- later Range requests send If-Range and check the Content-Range total;
the central directory is always prefetched in one request
- every fetch has a timeout (RangeOptions); nested .hap temp dirs are
removed on failure too
startup / upload / packing
- the npm version check no longer blocks every command: 1-day cache with
stale fallback, unref'd background request, hints printed after the
command (`help`: ~0.5 s -> ~0.09 s)
- getBaseUrl and dep versions resolve lazily; tty-table, app-info-parser,
form-data and progress load on first use
- payload deflate level 9 -> 6 (4x less CPU for 0.6% size)
- uploads get a size-scaled timeout and one retry on transient errors;
publish overlaps the upload with hashing and git; choosePackage reuses
the fetched list; native package upload passes the known bundle hash
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 734d4c6 commit 8e9cc2b
6 files changed
Lines changed: 29 additions & 63 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
23 | 32 | | |
24 | 33 | | |
25 | 34 | | |
| |||
549 | 558 | | |
550 | 559 | | |
551 | 560 | | |
| 561 | + | |
| 562 | + | |
552 | 563 | | |
553 | 564 | | |
554 | 565 | | |
| |||
635 | 646 | | |
636 | 647 | | |
637 | 648 | | |
638 | | - | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
639 | 658 | | |
640 | 659 | | |
641 | 660 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
| |||
0 commit comments