Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Imports https://github.com/dnfield/dart_path_parsing into this repository, with history, and updates it to follow repository conventions:

  • Updates minimum SDK support to match our minimum
  • Switches to repository analysis options, fixing or suppressing all resulting warnings
  • Standardizes pubspec.yaml to follow our style/conventions
  • Removes the use of pubspec.lock, per repo conventions

Dan Field and others added 24 commits July 30, 2018 10:48
* Improve path_parsing performance.

This code:
* Avoiding String.codeUnits.
* Reduces lookups to String.codeUnitAt
* Caches _length
* Builds integer value in a single pass.

String.codeUnits on both JS and VM returns a forwarding CodeUnits class defined here, so all lookups to codeUnits[index] actually go through an extra layer of dispatch.

Combined, all of these changes improve the parsing speed by ~25% when measured with real SVG path data.

parseSvgPathData() timing, measured on a Nexus 2 downclocked to 1GHz.

Before:
Run1: 76,124,392 us
Run2: 75,103,426 us
Run3: 75,481,128 us

After:
Run1: 59,319,622 us
Run2: 58,435,315 us
Run3: 58,478,007 us

* analysis cleanup

Co-authored-by: Dan Field <[email protected]>
* Use radians when rotating matrix

* less precision in tests
@google-cla
Copy link

google-cla bot commented Oct 21, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@stuartmorgan-g stuartmorgan-g marked this pull request as draft October 21, 2024 18:15
@stuartmorgan-g
Copy link
Collaborator Author

@zanderso Would you like to edit the README to add a note?

Also, currently we use CODEOWNERS in this repo; who should I list for this and the follow-up packages?

@zanderso
Copy link
Member

Yes, I'll edit the README. Working on the text, but I think this PR doesn't need to block on it?

A while back, @domesticmouse volunteered to be the owner for these for the purposes of mechanical updates with more involved issues in flutter_svg being owned by @jonahwilliams and the engine team.

@stuartmorgan-g stuartmorgan-g marked this pull request as ready for review October 24, 2024 18:26

Split from the Flutter path drawing library to create a pure Dart parsing
library for SVG paths and code generation (without dependencies on Flutter
runtime). No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Add trailing EOL at EOF

@stuartmorgan-g stuartmorgan-g merged commit e0c4f55 into flutter:main Oct 25, 2024
75 checks passed
@stuartmorgan-g stuartmorgan-g deleted the import-path-parsing branch October 25, 2024 15:02
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 25, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants