Add native SVG polyline path serializer and bump ABI to 36#94
Merged
Conversation
Merging this PR will improve performance by ×2.7
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|
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.
Motivation
Description
35to36in bothsrc/lib.rsandpython/xy/_native.pyto account for the new FFI entry.svg::poly_pathin a newsrc/svg.rsmodule that formats screen-space coordinates into an SVG path string with the same fixed-point formatting as the public SVG exporter.xy_svg_poly_pathinsrc/lib.rsthat returns the required byte count and supports size-query retries, and wire its signature into the Pythonctypeswrapper inpython/xy/_native.py.svg_poly_paththat calls the FFI with a resizable buffer, and switch_poly_pathinpython/xy/_svg.pyto use_native.svg_poly_path.src/svg.rsand a Python testtest_native_svg_poly_path_format_and_validationintests/test_kernels.pyto validate formatting and error handling.Testing
cargo test, and the newsvg::poly_pathtest passed.pytest, including the newtests/test_kernels.py::test_native_svg_poly_path_format_and_validation, and all tests passed.svg_poly_pathwrapper in the added test.Codex Task