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]
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.