Right now each isolate can have one port registered at the eventhandler.
When the timer expires the isolate will be notified. The isolate can
also cancel it's timer.
The timer implementation in the eventhandler is implemented as a linked
list, sorted by expiration date. Removing an entry for a given port will
perform a linear search. This O(N) search can be very problematic as the
number of isolates scales, effectively leading to O(N^2) behavior if N
isolates register/cancel N timers.
The priority_heap.h/priority_heap_test.cc was imported from the
implementation in "github.com/dartino/sdk".
Issue https://github.com/dart-lang/sdk/issues/44457
TEST=runtime/bin/priority_heap_test.cc
Change-Id: I657c1c1ac0c68ade5295b2569e3fb1a3478325ec
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175729
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>