Improve time tracking overheads a bit 59/83259/3
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 25 Jul 2019 22:38:30 +0000 (00:38 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 25 Jul 2019 22:55:50 +0000 (00:55 +0200)
commit7fbf2d3b2ef7b03fab9208e03a27e053acd415e2
treed8e0fda95746b3ebbd2f96074c1ea55c0c6fc8bb
parent01516001c5300e9463c63462f636b4f66436cee4
Improve time tracking overheads a bit

We are performing unneeded computation when we are rescheduling
the keepalive timer:
- we always convert the keepAlive timer from seconds to nanos
  when checking expiry
- we are forcing netty to translate seconds to nanos again when
  we are re-scheduling the timer
- we end up doing a superfluous addition, which then undone when
  we are computing the next duration

This normalizes all the timer delays to nanoseconds, so we
eliminate these inefficiencies.

JIRA: BGPCEP-872
Change-Id: Ic5912020a1cfa0df4fc6d4cf401d846cd9140ee4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPSessionImpl.java