Skip to content

Implement power-of-2 based copying while printing. #4

Description

@typesanitizer

Currently when a codel dimension of n is specified (the --dim flag), the Printer module creates the image in a stupid manner; it first fills one pixel, then copies that over to the n-1 pixels in its column, then copies that column n-1 times across the row. This fills one entire codel. Rinse and repeat for all codels.

It seems that whenever codel size > pixel size, this takes up, by far, the most time during codegen, despite being a relatively silly thing.

It would be better if we had power-of-2 based copying, i.e., copy 1 → copy 2 → copy 4 → ... instead. Of course, one needs to properly check for the edge cases, e.g. when the codel edge size is not an exact power of 2.

Implementing this (assuming we get the appropriate codegen speedup) would make using the default settings (1 codel = 8x8 pixels) much less painful to use for small programs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions