feat: add set_tags for updating multiple tags in one go - #1993
Conversation
When setting multiple tags, out-of-process handlers only need to flush the scope once.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 36099d1. Configure here.
JoshuaMoelans
left a comment
There was a problem hiding this comment.
very nice, simple, yet elegant improvement 🚀 did you happen to benchmark how much this enhances performance 👀
Very rough numbers measured on Windows using Before (~2-4 ms)sentry_set_tag("foo", "111");
sentry_set_tag("bar", "222");
sentry_set_tag("baz", "333");
sentry_set_tag("qux", "444");After (~0.5-1 ms)sentry_value_t tags = sentry_value_new_object();
sentry_value_set_by_key(tags, "foo", sentry_value_new_string("111"));
sentry_value_set_by_key(tags, "bar", sentry_value_new_string("222"));
sentry_value_set_by_key(tags, "baz", sentry_value_new_string("333"));
sentry_value_set_by_key(tags, "qux", sentry_value_new_string("444"));
sentry_set_tags(tags);
|
|
Q:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1993 +/- ##
==========================================
- Coverage 75.56% 74.23% -1.34%
==========================================
Files 91 104 +13
Lines 22129 25701 +3572
Branches 3948 4640 +692
==========================================
+ Hits 16722 19078 +2356
- Misses 4542 5314 +772
- Partials 865 1309 +444 🚀 New features to boost your workflow:
|
let's keep |

Makes a significant difference in terms of performance when updating multiple tags, because out-of-process handlers only need to flush the scope once.