Skip to content

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