-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
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.
sentry/src/sentry/grouping/enhancer/__init__.py
Lines 128 to 132 in ad474a7
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:
sentry/src/sentry/grouping/enhancer/__init__.py
Lines 335 to 336 in ad474a7
for action in self.actions: | |
rv.append((idx, action)) |
Even though the group
action does not do anything in this specific case:
sentry/src/sentry/grouping/enhancer/actions.py
Lines 93 to 95 in 4b7fc05
# 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.