Skip to content

Commit

Permalink
Minimize memory footprint of HashedWheelTimer and context-switching
Browse files Browse the repository at this point in the history
Motivation:
At the moment there are two issues with HashedWheelTimer:
* the memory footprint of it is pretty heavy (250kb fon an empty instance)
* the way how added Timeouts are handled is inefficient in terms of how locks etc are used and so a lot of context-switching / condition can happen.

Modification:
Rewrite HashedWheelTimer to use an optimized bucket implementation to store the submitted Timeouts and a MPSC queue to handover the timeouts.  So volatile writes are reduced to a minimum and also the memory foot-print of the buckets itself is reduced a lot as the bucket uses a double-linked-list. Beside this we use Atomic*FieldUpdater where-ever possible to improve the memory foot-print and performance.

Result:
Lower memory-footprint and better performance
  • Loading branch information
Norman Maurer committed May 11, 2014
1 parent 10ab0db commit 1f68479
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 197 deletions.
Loading

0 comments on commit 1f68479

Please sign in to comment.