Skip to content
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

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

Open
typesanitizer opened this issue Oct 23, 2017 · 0 comments
Open

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

typesanitizer opened this issue Oct 23, 2017 · 0 comments

Comments

@typesanitizer
Copy link
Owner

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.

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

No branches or pull requests

1 participant