netty5/microbench
Nick Hill feb804dca8 Avoid extra Runnable allocs when scheduling tasks outside event loop (#9744)
Motivation

Currently when future tasks are scheduled via EventExecutors from a
different thread, at least two allocations are performed - the
ScheduledFutureTask wrapping the to-be-run task, and a Runnable wrapping
the action to add to the scheduled task priority queue. The latter can
be avoided by incorporating this logic into the former.

Modification

- When scheduling or cancelling a future task from outside the event
loop, enqueue the task itself rather than wrapping in a Runnable
- Have ScheduledFutureTask#run first verify the task's deadline has
passed and if not add or remove it from the scheduledTaskQueue depending
on its cancellation state
- Add new outside-event-loop benchmarks to ScheduleFutureTaskBenchmark

Result

Fewer allocations when scheduling/cancelling future tasks
2019-11-04 11:57:53 +01:00
..
src/main Avoid extra Runnable allocs when scheduling tasks outside event loop (#9744) 2019-11-04 11:57:53 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2019-10-24 12:57:00 +00:00
README.md Change the netty.io homepage scheme(http -> https) (#9344) 2019-07-09 21:09:42 +02:00

Microbenchmark tests

See our wiki page.