Example

Faster rectangle algorithm

3

SP4CEBAR 2022-12-31 09:10 (Edited)

Update: It now hovers around 60% CPU usage
Previously It hovered around 80% CPU usage
And before that it was over 100% CPU usage

Optimizations:
- write segments instead of pixels (was already used in the previous versions)
- segments are generated once per rectangle
- the FILL command is used on the center segments
- ROM like FFFFFFFFFFFFFFFF0000000000000000, 0000000000000000FFFFFFFFFFFFFFFF, and FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF but each of them repeated 32 times is used with the COPY command to write a whole ROW of fully filled cells even faster

Pretty Fast.nx | Open in app
2022-12-31 10:26
Pretty Fast.nx | Open in app
2022-12-31 10:00
Pretty Fast.nx | Open in app
2022-12-31 09:10

SP4CEBAR 2022-12-31 10:12 (Edited)

The bottleneck is the drawing of the left and right sides, these need to overlay the pixel bits for each row, ending the sub there (it's the first thing of the rectangle to be drawn) leaves it at 50% cpu
the preparations only take 1% of CPU


nitrofurano 2022-12-31 15:44

excellent! :)


Log in to reply.