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

[0.1] Stop checking ChannelLiquidity's in-memory size #3610

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

We generally expect ChannelLiquidity to be exactly three cache lines to ensure the first bytes we need are all one one cache line. This improves performance very marginally on some machines, but the assertions that this is true do not work on some Android 32-bit machines due to differing Duration sizes.

Here we simply remove the assertions to fix build on platforms where the struct size isn't exactly on cache lines. This may marginally harm performance but it shouldn't be that critical.

Fixes #3415

We generally expect `ChannelLiquidity` to be exactly three cache
lines to ensure the first bytes we need are all one one cache line.
This improves performance very marginally on some machines, but
the assertions that this is true do not work on some Android 32-bit
machines due to differing `Duration` sizes.

Here we simply remove the assertions to fix build on platforms
where the struct size isn't exactly on cache lines. This may
marginally harm performance but it shouldn't be that critical.

Fixes lightningdevkit#3415
Copy link
Contributor

@jkczyz jkczyz left a comment

Choose a reason for hiding this comment

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

Could this be conditionally compiled when not the specific Android target?

@TheBlueMatt
Copy link
Collaborator Author

Could this be conditionally compiled when not the specific Android target?

My more recent bencharks seem to show that even smarter layout than this doesn't get us the kind of win I saw previously, so I'm not sure its worth it.

@TheBlueMatt TheBlueMatt merged commit fe45095 into lightningdevkit:0.1 Feb 21, 2025
23 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants