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

Improve unwind information chunking and optimise unwind info #4

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

javierhonduco
Copy link
Owner

Before we were splitting only on function boundaries, but this is not necessary, we can split anywhere as long as the end of function markers are in place for every single function that has a gap with the next function (sorted by PC), as well as the last function.

By doing this, we not only use the unwind shard space more efficiently, but also we support huge functions better, and have to do less work, while making the code more readable.

The cases that we have to handle (just showing PCs and generated chunk ranges):

  • [10, 20, 30]

    ^ split here => [10, 19] and [20, 30]
    
  • [10, 20, 30]

           ^ 'split' here => [10, 30]
    

Additionally, this commit also does some basic optimisations w.r.t. the unwind information, we remove redundant end of function markers as well as unwind rows that are repeated.

Test Plan

Tested for hours on my box and simulated worst case scenarios with very small unwind shards (few hundreds of items) without issues. Also wrote some exhaustive checker for these conditions, but the code isn't ready to be added yet, will submit a separate PR where all this logic is abstracted and the tests are added.

Before we were splitting only on function boundaries, but this is not
necessary, we can split anywhere as long as the end of function markers
are in place for every single function that has a gap with the next
function (sorted by PC), as well as the last function.

By doing this, we not only use the unwind shard space more efficiently,
but also we support huge functions better, and have to do less work,
while making the code more readable.

The cases that we have to handle (just showing PCs and generated chunk ranges):

-  [10, 20, 30]

       ^ split here => [10, 19] and [20, 30]

-  [10, 20, 30]

              ^ 'split' here => [10, 30]

Additionally, this commit also does some basic optimisations w.r.t. the
unwind information, we remove redundant end of function markers as well
as unwind rows that are repeated.

Test Plan
=========

Tested for hours on my box and simulated worst case scenarios with very
small unwind shards (few hundreds of items) without issues. Also wrote
some exhaustive checker for these conditions, but the code isn't ready
to be added yet, will submit a separate PR where all this logic is
abstracted and the tests are added.
@javierhonduco javierhonduco merged commit 82f8496 into main Mar 22, 2024
2 checks passed
@javierhonduco javierhonduco deleted the improve-unwind-info-chunking branch March 22, 2024 11:57
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.

1 participant