Repository navigation
Conversation
ldm0
force-pushed
the
perf/positioned-visual-clusters
branch
from
October 15, 2026 21:21
c0f1f3f to
a18cfc3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moli currently has to reproduce Parley's visual item positioning to avoid calling the linear-time
Cluster::visual_offset()for every cluster. AddLine::positioned_visual_clusters(), yielding(Cluster, f32)in visual left-to-right order with no position cache or heap allocation, so consumers can obtain all positions in one pass.Offsets include
LineMetrics::offsetand excludeinline_min_coord, matchingvisual_offset()bit for bit. Preceding runs userun.advance()while clusters within a run usecluster.advance(), preserving spacing, justification and floating-point summation order. The iterator reads Parley's current visual item stream directly, including inline boxes and host item reordering, and supports cloning and iterator adaptors.Validation:
cargo fmt --allcargo clippy --workspace --all-targets --all-features -- -D warningscargo nextest run --no-fail-fast: 502 passed, 1 skipped.RUSTDOCFLAGS='--cfg docsrs -D warnings' cargo +nightly doc --workspace --all-features --no-deps --document-private-itemscargo check -p parley --no-default-features --features libmvisual_offset()implementation, using exact float bits.Added release benchmarks comparing the two library access patterns on already-built layouts. Final revision
a18cfc3ba6638d44ff0d0c9ce7b0b3396b42e8cf, Intel Core i9-13900K, rustc 1.94.0. Three separate process runs, 100 samples per case; the table reports the median of the three process means as rounded by Tango:visual_offset()Reproduce with
cargo +1.94.0 bench -p parley_bench --bench main -- solo --filter 'Cluster Positions -*' --samples 100 --seed 20261016.These measurements compare Parley's public API access patterns. Moli already has a linear accumulator after lexmount/moli#1434; the integration consolidates ownership of that existing algorithm.
The base is
fix/inline-object-bidi-rebasedatd0f5452487b872562102fde2c133d445272bcccc, the exact revision currently used by Moli, to avoid pulling unrelated fork changes into the integration.Moli consumer integration: lexmount/moli#1599.