pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

Optimize negative_acks_tracker by time_wheel

Open EAHITechnology opened this issue 4 years ago • 2 comments

In the case that the task trigger time is relatively late, it is possible that the time complexity of traversing a map is O(n), but nothing is actually done, which leads to a waste of CPU time. The time wheel data structure can effectively reduce the order of magnitude of scanning. At the same time, this part of the logic can also be hidden behind the business logic in the internal.go

EAHITechnology avatar Sep 14 '21 05:09 EAHITechnology

Curious how does this improve or enhance the current implementation? Why would users want to use this over what is currently there? What is the added overhead?

cckellogg avatar Sep 14 '21 18:09 cckellogg

Thanks @EAHITechnology work for this.

I am a little confused here, why do we need to use the time wheel to handle nack tasks?

wolfstudy avatar Sep 16 '21 13:09 wolfstudy