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

Breadcrumbs should use more efficient ringbuffer #1006

Closed
Swatinem opened this issue Jun 7, 2024 · 0 comments · Fixed by #1060
Closed

Breadcrumbs should use more efficient ringbuffer #1006

Swatinem opened this issue Jun 7, 2024 · 0 comments · Fixed by #1060
Assignees

Comments

@Swatinem
Copy link
Member

Swatinem commented Jun 7, 2024

Adding a breadcrumb right now is using sentry__value_append_bounded to limit the number of breadcrumbs according to settings:

sentry__value_append_bounded(
scope->breadcrumbs, breadcrumb, max_breadcrumbs);

However that internally does a costly memmove:

memmove(l->items, l->items + to_shift, to_move * sizeof(l->items[0]));

It would be nice to find a way to optimize this, for example by using a ringbuffer / linked list, or some other method to avoid doing a O(n) memmove every time when adding breadcrumbs that are at their maximum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants