Skip to content

vectorio: speed up polygon #2888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 18, 2020
Merged

Conversation

kvc0
Copy link

@kvc0 kvc0 commented May 13, 2020

Takes polygon from 126k pixels per second fill to 240k pps fill
on a reference 5 point star 50x66px polygon, updating both location and shape
at 10hz. Tested on an m4 express feather.

As a curiosity, the flat-out fill rate of a shape whose get_pixel is return 0;
fills just shy of 375k pixels per second.

Baseline:

Polygon -> shape:{1020px,  8.1ms, 126603.0pps fill}  shape_pixels:{5859.4us total,  5.7us/px}
Polygon -> shape:{ 510px,  4.0ms, 126603.0pps fill}  shape_pixels:{2929.7us total,  5.7us/px}

This change:

Polygon -> shape:{1020px,  4.3ms, 238738.0pps fill}  shape_pixels:{2807.6us total,  2.8us/px}
Polygon -> shape:{ 510px,  2.1ms, 245759.0pps fill}  shape_pixels:{ 976.6us total,  1.9us/px}

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Nice speedup! One suggestion to remove duplication. All good otherwise.

@kvc0 kvc0 force-pushed the vectorio-polygon-speed branch from e2dabae to 03bd9eb Compare May 14, 2020 04:59
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Now needs a .po merge. (Allow maintainers to edit and I can fix it for you. ;-) )

@kvc0
Copy link
Author

kvc0 commented May 15, 2020

Now needs a .po merge. (Allow maintainers to edit and I can fix it for you. ;-) )

Ah there's that silly button. Fix away and thanks :-D

@tannewt
Copy link
Member

tannewt commented May 15, 2020

@WarriorOfWire For some reason I couldn't push to your branch still. I pushed the merge to my corresponding branch if you want to snag it from there.

@kvc0 kvc0 force-pushed the vectorio-polygon-speed branch from 462355c to 18324e4 Compare May 16, 2020 20:59
@kvc0
Copy link
Author

kvc0 commented May 16, 2020

This PR got too dirty; I've rebased the intended changes on master to keep the changelog clean. Should be good to go.

kvc0 added 3 commits May 18, 2020 13:32
This change takes polygon from 126k pixels per second fill to 240k pps fill
  on a reference 5 point star 50x66px polygon, updating both location and shape
  at 10hz.  Tested on an m4 express feather.

As a curiosity, the flat-out fill rate of a shape whose get_pixel is `return 0;`
  fills just shy of 375k pixels per second.
@kvc0 kvc0 force-pushed the vectorio-polygon-speed branch from 18324e4 to a78f245 Compare May 18, 2020 20:34
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

@tannewt tannewt merged commit 2e950a0 into adafruit:master May 18, 2020
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.

2 participants