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

Micro-optimize normalize_stacktraces_for_grouping #51354

Closed
Swatinem opened this issue Jun 21, 2023 · 1 comment
Closed

Micro-optimize normalize_stacktraces_for_grouping #51354

Swatinem opened this issue Jun 21, 2023 · 1 comment
Assignees

Comments

@Swatinem
Copy link
Member

The function is slow, presumably because apply_modifications_to_frame of grouping enhancers is slow.
Here are a couple of ideas of how to optimize that.

Consider the following example enhancement rule:

family:native function:_CxxThrowException                         ^-group -group ^-app -app

This rule has 4 actions.

for rule in self._modifier_rules:
for idx, action in rule.get_matching_frame_actions(
match_frames, platform, exception_data, cache
):
action.apply_modifications_to_frame(frames, match_frames, idx, rule=rule)

As the rule itself is a modifier_rule, all of its 4 actions are being applied:

for action in self.actions:
rv.append((idx, action))

Even though the group action does not do anything in this specific case:

# Grouping is not stored on the frame
if self.key == "group":
return

Idea: Further split rules/actions when the modifier/updater split happens to useless actions are not called.

Then again, ^-group -group is two separate rules that are applied separately.

Idea: Maybe we can merge these two rules into one? We would then have a rule with an inclusive range, instead of two rules with an exclusive range and an exact index.

Swatinem added a commit that referenced this issue Jun 22, 2023
This properly splits up multi-action enhancement `Rule`s so only
modifier actions are run for modifier rules.

The first half of #51354
@Swatinem
Copy link
Member Author

Splitting of enhancement rules was implement in #51358, and #51781 was opened as a followup to track ideas about how to merge multiple enhancement rules into one.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant