Better trace ids
This PR changes the generation of trace ids (also renamed to span ids) in order to remove massive performance hit for certain models. In my benchmark, the generation of trace IDs affected benchmarks by a factor of 7! And this was even without enabling the callbacks. The current PR changes the implementation a bit by calling an auxiliary function `ReactiveMP.generate_span_id` that would simply return `nothing` if callbacks are also `nothing`. That fixes the performance hit in case when callbacks are not set, but otherwise it still uses `uuid4` (definitely **the** culprit). We may want to use a simple global Int counter for that? Not sure if it would be faster though since this counter would need to be guarded with semaphores to protect from two threads generating the same span ID.
@fonsp wdyt?
合并状态:未合并 2 条评论