| commit | a66ef954275f1213aa34d8b487b9e0dc886a7cf7 | [log] [tgz] |
|---|---|---|
| author | Konstantin Shcheglov <scheglov@google.com> | Thu Sep 25 11:22:50 2025 -0700 |
| committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Sep 25 11:22:50 2025 -0700 |
| tree | e18fbaf357bc390796fc98d5e5e248f3501dd063 | |
| parent | b01bf92f9ae8addfd698173df2a6279dbe28e2dd [diff] |
Fine. Deduplicate manifest IDs in binary format
Introduce a manifest-ID table to deduplicate `ManifestItemId`s during
serialization and shrink stored artifacts. IDs are now written once per
blob and referenced by varint indices, reducing bundle size with a small
write-time overhead.
Key changes:
- Add `ManifestIdTableBuilder` and encode IDs via table indices.
- Add `BinaryWriter.writeManifestItemId` / `BinaryReader.readManifestItemId`;
redirect `ManifestItemId.write/read` to these helpers.
- Replace `StringIndexer` with `StringTableBuilder` (same behavior, new name).
- Introduce a unified trailer:
- Layout: `<payload><manifest_id_table><string_table><u32 idOff><u32 strOff>`
- New APIs: `BinaryWriter.writeTableTrailer()` and
`BinaryReader.initFromTableTrailer()`.
- Update all call sites that write/read analyzer bundles
(e.g. `LinkedBundleProvider`, `LibraryDiagnosticsBundle`,
manifest/requirements serializers) to the new trailer.
- Keep summary2 bundle format unchanged; it still uses its own four-u32
footer. Calls there switch to `initStringTableAt(stringsOffset)` only.
- Simplify `ManifestItemId.hashCode` for faster lookups.
- Propagate tables across `BinaryReader.fork()` to avoid reinitialization.
- Bump data format: `AnalysisDriver.DATA_VERSION` 561 → 562.
Impact (bundleProvider.put):
- Size: 42,694,174 → 33,591,531 bytes (−9,102,643; −21.32%).
- Write time: 179.650 ms → 201.271 ms (+21.621 ms; +12.04%).
Motivation: Consolidating manifest IDs removes repeated 64-bit values
from payloads, cutting I/O and storage while keeping deserialization
simple and fast.
Change-Id: I886a8d5a745f81a94c7bca126193cb1460d99fae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/451321
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Dart is:
Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.
Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents in our repo at docs.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.
Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.