Skip to content

Conversation

@matthiasgoergens
Copy link
Contributor

Not all correct cross table lookups use padding for the last row.

Not all `correct` cross table lookups use padding for the last row.
}

res
.map(|&(c, f)| table[c].values[(row + 1) % table[c].values.len()] * f)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you are worried about performance, you could also do & (table[c].values.len() - 1), taking advantage of the fact that we only work with powers of two. But this is confusing, and modern processors are fast.


On a wider scale, I thought of doing linear combinations on whole columns at once via batch_add_inplace etc, but it's not really worth it, because CTL data generation is such a small part of overall runtime.

Copy link
Collaborator

@Nashtare Nashtare May 21, 2024

Choose a reason for hiding this comment

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

If you are worried about performance, you could also do & (table[c].values.len() - 1), taking advantage of the fact that we only work with powers of two.

I don't mind having it (with an eventual comment for clarity), but this isn't an actual bottleneck at all anyway so probably negligible as you mentioned.

@Nashtare Nashtare merged commit 8030ea4 into 0xPolygonZero:main Jun 1, 2024
hratoanina pushed a commit that referenced this pull request Jul 16, 2024
Not all `correct` cross table lookups use padding for the last row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants