Skip to content

Breadcrumbs should use more efficient ringbuffer #1006

@Swatinem

Description

@Swatinem

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions