Skip to content

Commit f136642

Browse files
authored
Merge pull request #84 from gramaziokohler/perf/round-trip
Speed up round-trip without changing the wire format
2 parents 7eda085 + 011b670 commit f136642

6 files changed

Lines changed: 386 additions & 216 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
* Breaking: The wire format changed in a way that is not backwards compatible. Once the version is bumped at release, data serialized by older versions will be refused on deserialization (the wire-version check is now a hard gate; compatibility follows SemVer — under 0.x every minor is breaking, from 1.0 on only major bumps are).
2424
* Breaking: Auto-generated guids no longer round-trip. They were always session-local `uuid4`s and never stable across save/load; only explicitly set guids are now serialized.
2525
* Reworked the wire format into a fully lossless binary mode: all geometry coordinate/scalar fields are now `double` instead of `float`, so `float64` geometry round-trips exactly.
26+
* Improved serialization/deserialization performance without changing the wire format: plugin discovery now runs once per operation instead of once per element, the legacy Any-unpacking probes in `_deserialize_any` only run for Any-packed messages, and the columnar attribute/mesh writers drop a redundant sort and per-element proto calls. Mesh serialize is ~2x faster and graph round-trip ~1.5x faster.
27+
* Changed mesh serialization to read vertex `x`/`y`/`z` from the vertex attribute dict (falling back to `default_vertex_attributes`) instead of calling `Mesh.vertex_coordinates()`. `Mesh` subclasses that override `vertex_coordinates()` to *compute* coordinates rather than store them will therefore serialize the stored/default values, not the computed ones. Subclasses that only store coordinates — the normal case, including every `Mesh.from_*` constructor — are unaffected. If you rely on a computed override, write the resulting coordinates into the vertex attributes before serializing, or register your own serializer for the subclass.
2628
* Changed `AnyData` to use explicit `int64`/`double`/`dict_value`/`list_value` arms instead of routing values through `google.protobuf.Value`/`Any`, so integral floats no longer come back as ints and nested dicts/lists no longer carry a type URL. `Mesh`/`Graph` are now fully lossless (canonical hash matches).
2729
* Changed mesh vertices, pointcloud, polyline, polygon, bezier and polyhedron points to a flat packed `repeated double` layout, and mesh faces to CSR form (`face_vertices` + `face_sizes`), instead of one message per point/face.
2830
* Changed per-element attributes (mesh vertices/faces/edges and graph nodes/edges) to a columnar `repeated AttributeColumn` layout with packed numeric arrays, replacing the previous per-element `map<string, AnyData>`. Empty/absent attribute sets cost nothing.

0 commit comments

Comments
 (0)