Note that the two commits should NOT be squashed as the second one contains benchmarking code.
Turns out GitHub saves the PR history even when squashing, so nevermind since I feel like these commits are messier.
The one major downside of this caching is that for long-running applications which occasionally have super long field values, we have no way of reclaiming that memory. I think that's ok until someone actually runs into this issue and can tell us more about their needs. For example, maybe we offer a "clear cache" API that they could run? Or maybe they need to configure the max cache size? Not sure, so probs easiest to wait unless you think this needs to be solved (in which case I'd rather do that in a follow up PR). TL;DR: the memory usage currently scales as O(num_active_spans*max_field_value_length).
The results are in: almost double the performance!
Depends on https://github.com/nagisa/rust_tracy_client/pull/85. Will rebase once that's in.Done.Note that the two commits should NOT be squashed as the second one contains benchmarking code.Turns out GitHub saves the PR history even when squashing, so nevermind since I feel like these commits are messier.
The one major downside of this caching is that for long-running applications which occasionally have super long field values, we have no way of reclaiming that memory. I think that's ok until someone actually runs into this issue and can tell us more about their needs. For example, maybe we offer a "clear cache" API that they could run? Or maybe they need to configure the max cache size? Not sure, so probs easiest to wait unless you think this needs to be solved (in which case I'd rather do that in a follow up PR). TL;DR: the memory usage currently scales as O(num_active_spans*max_field_value_length).
The results are in: almost double the performance!
Before:
After: